In Sql Server when I create a layer the OBJECTID is defined as primary key.
When I create a table (using ArcMap) the OBJECTID is not define as primary key.
See the screen shot, AAA is a layer (have a shape filed), BBB is a table.
Any reason for this?
Thanks
Mody
I just ran into this issue... oddly it appears to be different if the database is 'geodatabase enabled' or not ... at least on SQL Server. I just created a table via ArcCatalog on a plain/non-geodatabase database connection and the OBJECTID column is set as the primary key by default.
From a quick test, it seems the behaviour is not same in an Oracle Enterprise gdb.
A Feature Class created in an Oracle sde gdb, does not have the ObjectID as a Primary Key.
What is an ObjectID?—Help | ArcGIS Desktop
An ObjectID is a unique, not null integer field used to uniquely identify rows in tables in a geodatabase. ObjectIDs are limited to 32-bit values, which store a maximum value of 2,147,483,647.
So this satisfies the requirement for an ObjectID atleast.
Yes, they may not be the same and hence the question could be "Why does ArcGIS create a Primary Key in case of Feature Classes, but a Unique Index in case of Geodatabase Tables?"
Index is not the same as primary key
See the key icon next to the OBJECTID field that exists in TESTFC and does not exists in TESTTABLE
There is a Unique Key created in case of Tables:
Yes I just did right click on the database connection and select New->Table
Mody,
Is BBB table is a non-spatial table?
~Shan
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.