I have an ordinary table with OBJECTID column (type of int) in a MS SQL Server 2008 R2 instance. I need to store it in an ArcSDE geodatabase instance running on top of the SQL Server. The thing is how to make the OBJECTID field to the esri-compliant Object ID type so that feature operations through Feature Server can be applied down the track?
1 Answer
You may like to use following command:
sdetable -o register -t <table>
[{-c <row_id_column> -C {SDE|USER} } | {-C NONE} ]
[-k <config_keyword>]
[-i <service> | <port#> | <direct connection>] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-q]
However while you are at it, make sure that you specify -C ObjectID
and -C User
which will tell SDE that the ObjectID
is the unique Id field and it is maintained by the user. You may like to refer to command reference for more info on this.
Hope this helps!