Creating ESRI_OID in SQL Server

4361
2
Jump to solution
05-14-2015 07:59 AM
Highlighted
Occasional Contributor

I have read-only access to a non-spatial SQL server. The table I want to use doesn't have object IDs, needed for queries, while another table shows the ESRI_OID field ("shows" as it really isn't in the table). How do I get the ESRI_OID field to show in the table? Also, I'm unable to Register with Geodatabase. If I were to have a new OID field added to the SQL table, what do I tell the database administrator, create a random number field?

Thanks,

Scott

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Esteemed Contributor

There are a couple tools, or more, in the Layers and Table Views toolset that should work for you:  Make Query Table, Make Query Layer.  These tools will create virtual key fields, i.e., ESRI_OID, for you.

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
MVP Esteemed Contributor

There are a couple tools, or more, in the Layers and Table Views toolset that should work for you:  Make Query Table, Make Query Layer.  These tools will create virtual key fields, i.e., ESRI_OID, for you.

View solution in original post

Reply
0 Kudos
Highlighted
Occasional Contributor

Thanks for the reply Joshua. I've had only minor success. Make Query Table errored as I believe that I need write access to the table. (I had success on writable tables.) When I employ Make Query Layer in a model, the output isn't recognized, using Get Count for testing. My only success was that I created the ESRI_OID field in ArcMap by Add Query Layer, but then my model, run from ArcMap, still doesn't recognize the query output.

At this point I'm going to have the database administrator add an OID field.

Scott

Reply
0 Kudos