Due to reasons beyond the scope of this question, I'm forced to import data into an SQL Server SDE database using SQL statements (importing using ArcGIS is not possible). The data already contains ObjectID values that I need to keep.

My idea was to create empty featureclasses first, then import the data, and finally execute sde.next_rowid several times to increase the ObjectID value for objects that will be inserted later. For example, if the data already has ID's 10–20, I need to execute sde.next_rowid 20 times, so that a new record will get ID 21.

Importing the data works, and executing sde.next_rowid too, or at least it seems so: I can see that the values for fields base_id and last_id in the i<reg_id> table are increased. However, if I insert data using ArcMap or ArcGIS Pro, new ObjectIDs still start counting at 1.

  • The GeoDatabase is version 10.8
  • SQL Server is version 2019

(Restarting ArcMap or Pro does not fix this)

  • I would recommend that you use this reconstituted database as a read-only source to populate a "final" geodatabase that does not have scores of compatibility and non-critical corruption issues. In this way, you're more likely to have a supportable database for the next geodatabase upgrade.
    – Vince
    Dec 17, 2020 at 21:19
  • @Vince Yes, that would be good advice in general. But I see now that maybe I should have given more background information ;-) The reason I'm doing this is that the data has Archiving enabled, and there is no way to copy historical data, or to re-attach _H tables, in ArcGIS itself. So even if I use the new database as a read-only source, this would merely move the problem.
    – Berend
    Dec 18, 2020 at 7:04
  • It looks like you have an XY Problem brewing here. If you had framed the question as "How do I transfer an Enterprise geodatabase feature class that has archiving enabled?" you might be closer to a solution. If you provide details on the type of archiving deployed, an InsertCursor or UpdateCursor solution could be suggested.
    – Vince
    Dec 18, 2020 at 14:47
  • @Vince, I asked the Esri support desk, and they told me it's not possible and advised me to use SQL statements. Anyway, it looks like if I call sde.next_rowid several times first, and then insert the data, new objects get a proper OID.
    – Berend
    Dec 18, 2020 at 15:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.