ArcGIS assumes a not nullable number field from another database is ObjectID and ignores it

765
1
11-04-2016 02:37 PM
BlakeTerhune
MVP Regular Contributor

I'm using an OLE DB connection to connect to another database (SQL Server) that has nothing to do with ArcGIS. The tables there all have a numeric key field that is not nullable. When I try to use ArcGIS Desktop (10.2.2) to copy the data it just assumes it's an ObjectID field and ignores it. How can I tell a geoprocessing tool that a field is not ObjectID or force it to include it?

0 Kudos
1 Reply
BlakeTerhune
MVP Regular Contributor

Of course, it always just takes rephrasing the question to post on GeoNet to make me think a little differently and figure out a solution. Since I'm doing this in a Python script, I found that if I make a Query Table first and use the "NO_KEY_FIELD" in_key_field_option, it will make a new ObjectID field that doesn't step on the key field that's already there. Then simply continue with Copy Rows (or Append in my case).