AnsweredAssumed Answered

Object name lengths on SQL Server?

Question asked by jasonbirch on Sep 18, 2013
Latest reply on Nov 14, 2017 by vangelo-esristaff
Hi all!  Get ready for a long first post...

We're in the progress of migrating to ArcSDE, starting with 10.1 running on SQL Server 2012 using an SDE-schema geodatabase.  One of the staff here has raised a concern about the maximum length of database name, schema owner, and feature class name in this scenario.  My initial implementation includes objects with compound names which are somewhat long (worst case):


Searching indicates that at some point in the past this concern may have been valid, where SDE may have limited table names to 32 characters.  However, current guidance from the Defining Feature Class Properties help topic seems to be:

"The length of feature class and table names depends on the underlying database. The maximum name length for file geodatabase feature classes is 160 characters. Be sure to consult your DBMS documentation for maximum name lengths."

Digging deeper, the SDE_table_registry table defines the component parts of the feature class as:

[INDENT]database_name: nvarchar(32)
owner: nvarchar(32)
table_name: sysname   - where sysname is a system type equal to nvarchar(128)

With this in mind, it appears that we should be safe with our current structure, with the primary constraints being to keep any future schema owner names under 32 characters, and table names under 128 characters.

I would really appreciate any guidance on whether this confidence is unfounded, and if there may be Esri or third-party components which still rely on shorter object names, and whether the total length of Database+Owner+Table is subject to any additional constraints.

I personally prefer to use descriptive object naming, but we're early enough in the implementation process that I can re-create the database and schema owners with shorter identifiers if required.