Select to view content in your preferred language

Field name restrictions in a geodatabase table

4319
11
09-21-2011 05:41 PM
ChristopherPettit
New Contributor
I have been working on creating a geodatabase and I am thinking about putting some tables in.  I wanted to check to see what the restrictions were for field names in a geodatabase table. 

Alphanumeric characters only, 64 characters in length, must start with a letter?

Do the restrictions differ with a geodatabase table as opposed to just adding a table from excel?

Sorry for such a bland newbie question, but surprisingly I can't find a specific answer anywhere.
0 Kudos
11 Replies
VinceAngelo
Esri Esteemed Contributor
This is the same as any SQL restriction.  First letter must be alpha.  Remaining letters may be
alpha-numeric or underscore.  No spaces. No hyphens (which would be interpreted as "minus").
Keep in mind that these column names will be substituted for by row contents when the SQL
algebra and calculus is applied, so math symbols and punctuation would make parsing the
SQL expressions difficult, at best.

While name length is limited to 64 characters, you should really expend effort in trying to keep
column names inside 20 characters (ideally, 30 max), just to make your SQL readable.  The only
reason you should keep the name under 11 characters is if you intend to make shapefiles out
them on a regular basis, but making sure the names differ in the first 10 characters will make
your life easier.

There is very little similarity between a column heading in a spreadsheet and a column name in
a database (the same level of similarity between spreadsheets and databases, come to think of it).

- V
0 Kudos
RobertHu
New Contributor II
Just add one piont. Don't use DB reserved keyword as your field name. For example, PRIMARY is a keyword for SQL Server (but not Oracle). If you use it for a feature class field name, you will end up something like "PRIMARY_" which can be an awfull field name.

If you are using SQL Server, following link lists keywords for T-SQL,

http://msdn.microsoft.com/en-us/library/ms189822.aspx
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Robert brings up a great point.  If you want your geodatabase to be portable, you should also
strive to check your naming against *all* RDBMS keywords (most of which are SQL reserved
words ["SELECT", "FROM",...], and many of which have overlap ["TABLESPACE"]).

- V
0 Kudos
ChristopherPettit
New Contributor
Thanks guys,

I appreciate the advice and all the advice you guys post on other threads.  The forum is a great place for new players in the game to figure things out.  I am not new to GIS but I am new to being responsible for GIS so this is all good advice for me.
0 Kudos
Zminazim
New Contributor

The maximum text string for a field in a geodatabase is 320 characters. The data I am importing has long character strings and it seems to be truncating when I convert into shapefile at the max text string and messing the fields up. Is there a way to extend this to 700-1000 characters?

PlexLucky Patcher Kodi

0 Kudos
VinceAngelo
Esri Esteemed Contributor

This question is not a logical extension of the post from seven years ago. You should have posted a new question, which would have to include the database which enforces a 320 character limit (I'm not aware of any that do).  Shapefiles have a much smaller limit: 254 bytes (fewer UTF-8 codepoints). There are a number of answered questions here which address string field width in various storage formats.

- V

0 Kudos
DanPatterson_Retired
MVP Emeritus

As Vince said...

there are limits

Geoprocessing considerations for shapefile output—Help | ArcGIS Desktop 

and shapefiles won't meet what is needed

And why is this post getting resurrected again

0 Kudos
VinceAngelo
Esri Esteemed Contributor

No, there is no such limit. As stated, repeatedly, "geodatabase" text fields are unlimited (2^31-1 UTF-16), though the underlying storage format may assert a lower value.

- V

0 Kudos
DanPatterson_Retired
MVP Emeritus

Vince... to clarify... shapefile limits exist...

0 Kudos