Thursday, July 9, 2009

Change ARCGIS Server ObjectID to be SQL Identity

To change objectID to be an identity controlled by SQL server for any business tables within ArcGIS server open a command prompt window and use the following SDETable commands.
Start by checking the table registration:

Type:

sdetable -o describe -t tablename




You will see under RowID Column the value SDE Set.


Now run the alter_reg command.
Type:
sdetable -o alter_reg -t tablename -c objectid -C USER -i servicename -D databasename -u user -p password

Now check the table registration again

Type:

sdetable -o describe -t tablename


You should see under RowID Column the value has been changed to USER set. You can now go into SQL Server Management Studio and make the ObjectID column an identity.


Warning: This should only be used for very special circumstances as you can really mess things up beyond repair. Only attempt this if you are 100% sure this is what you need, you have backups and you are not going to die for destroying the database.

No comments:

Post a Comment