0

When creating standalone tables in a geodatabase, what are the requirements for the OID/FID/ObjectID field name? Specifically, does it have to be named 'ObjectID'?

closed as primarily opinion-based by Vince, Fran Raga, whyzar, Erik, nmtoken May 2 at 13:45

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Have you asked Tech Support what the Esri recommendation is? I generally let ArcGIS name the registered rowid column (which is the formal name), and it will use objectid if it's available, but it certainly isn't required (since sometimes the input table(s) already have an "objectid" and it chooses "objectid_1" instead). – Vince Apr 26 at 17:13
  • @Vince Thanks for the input. See my edit. I'd love to see some reference backing up your claim. As for calling ESRI, i'm holding off for now. This forum usually answers my questions faster than tech support. – Barbarossa Apr 26 at 18:09
  • My "claim" is documented behavior (second bullet). You will NOT find any source that asserts that registered rowid columns are required to be named "objectid". You are attempting to prove a negative. If you want what Esri says, you should ask Esri. Asking anyone else is hearsay (aka opinion-based). – Vince Apr 26 at 18:24
  • I've read that. It only mentions naming if you register a table with the geodatabase that does not have a qualifying field. If i'm attempting to prove a negative, that asserts that there is proof to the contrary somewhere. If i will not find any source where rowid columns should be named "objectid", then perhaps there is a source saying i can name it anything i wish? So, is asking any ESRI related questions on this forum opinion-based? It's not hearsay if it's documented. – Barbarossa Apr 26 at 18:30
0

I was under the assumption that row id columns (thanks for the correct nomenclature Vince) MUST be named FID for shapefiles and ObjectID in geodatabases. Even creating a table in Catalog automatically creates a row id column named ObjectID. It has been pointed out that it isn't required to use ObjectID as the row id column name, but I couldn't find documentation on the subject. It is alluded to however.

What is an ObjectID does point out the following:

  • An ArcGIS-maintained ObjectID field is automatically added to any table created using ArcGIS.
  • If you register a table with the geodatabase that does not have a qualifying field, the geodatabase adds another field to the table that meets the requirements of an ObjectID and names it OBJECTID. If your table already contains a column that is named OBJECTID, the geodatabase adds a column named OBJECTID_1.
  • If you register a table with the geodatabase and the table does contain a qualifying field (integer, not null), the existing column can be used as the ObjectID.

So if a table does contain a qualifying field (integer, not null), it can be used as the ObjectID, or row id column. This also states that one or more fields ( Integer (positive values only), String, GUID, Date ) can be used as row id columns. In the case of multiple fields, ArcGIS adds a field named ESRI_OID. However, neither discuss naming restrictions, so it can be assumed that naming methods of any field apply to row id column names as well.

Defining fields in tables states that

Field names in the same table must be unique; for instance, you can't have two columns with the name ObjectID. Field names must also start with a letter and not contain spaces or reserved words. Field names are limited to 64 characters for both file and personal geodatabases, 31 characters in SQL Server and SQLExpress, 30 characters in Oracle and DB2; dBASE is limited to 10 characters.

I've tested this and the row id column can be named anything I wish, as long as it adheres to the standard above.

Perhaps to someone with a better understanding of or more experience with ArcGIS behavior wouldn't have had trouble with this. However, I believe the question is something that many ArcGIS users don't have to worry with as they take it as ArcGIS gives it to them.

Not the answer you're looking for? Browse other questions tagged or ask your own question.