reset feature class objectid after table is truncated

8980
5
12-08-2016 08:20 AM
HelenZhou
Occasional Contributor II

I have a procedure which truncates a feature class and adds new records to the truncated feature class. This procedure is run every night. Every time the new records are added to the feature class, the objectID is increased based on the largest objectID of the records that are truncated. I understand the objectID is maintained in SDE to make sure it is unique. Is there a way that the objectID can be reset to start from "1" after the table are truncated? The table is not versioned, not archived.

Thanks

Helen

0 Kudos
5 Replies
DuncanHornby
MVP Notable Contributor

I don't know if this applies to your situation but if you compact a personal/file geodatabase then the ObjectID resets to 1 on an empty table.

BatbayarBazarragchaa
New Contributor III

Seems like the ID is generated and stored in separate tables: i200, i201, i202 etc.

But you have to find the correct index table for each feature class which I couldn't find.

0 Kudos
WilliamSteichen
New Contributor

You can find the ID table by looking up the Attibute Index ID. Go to the table/featureclass in Arccatalog. Right click go to properties. Then go to the Indexes tabe. You should have an index for Objectid that R298_SDE_ROWID_UK. That number 298 is the table I298 which holds the next objectid.

0 Kudos
Asrujit_SenGupta
MVP Regular Contributor

Helen  You may be hitting the below Bug:

BUG-000092974: ObjectID sequence values do not reset to 1 after run.. 

BUG-000092974 - ObjectID sequence values do not reset to 1 after running the Truncate Table tool with background geoprocessing enabled.

It seems to be fixed in the upcoming 10.5 release. Disable Background Geoprocessing, if it is enabled and then give it a try for now.

GeodatabaseManaging DataEnterprise GIS

HelenZhou
Occasional Contributor II

I have to set up the feature class as non-versioned and use truncate table tool to truncate the table. The objectID is reset this way. Thank you all for help.