AnsweredAssumed Answered

Replacing SDE commands with python scripts...

Question asked by ryarbrough on Sep 15, 2014
Latest reply on Mar 7, 2016 by mathew.hay.hri

I've recently upgraded my ArcGIS server from 10.0 to 10.2, and I need to figure out how to replace the ArcSDE commands that I used to register my feature classes and spatial views with python commands.  The situation is that each year, a number of spatial tables are copied to new schemas, and the tables are then registered within SDE. 


Essentially I was previously using commands similar to the following...


sdelayer -o delete -l W_FIELD_EXPORT_SV,shape -u <user> -i <instance> -p <password> -N

sdelayer -o register -l W_FIELD_EXPORT_SV,shape -e nac+ -t ST_GEOMETRY -C OBJECT_ID,SDE -E -13744558,2980372,-7409316,6335845 -R 39 -u <user> -i <instance> -p <password> 

sdetable -o describe -t W_FIELD_EXPORT_SV -u <user> -i <instance> -p <password>

sdetable -o grant -t W_FIELD_EXPORT_SV -U VIEW_AGS -A SELECT -u <user> --p <password> -i <instance>


I've found the arcpy.RegisterWithGeodatabase_management toolbox command, but the drawback to that is that it seems that there is no way to specify a column other than OBJECTID for the ID column.  As is shown in my example the column OBJECT_ID is being used for the ID.  The toolbox command also does not let me specify the feature class envelope (-E), or the spatial reference ID (-R).  Perhaps those parameters are no longer necessary with ArcGIS 10.2?


Any help, or explanations about how I should go about replacing this process would be greatly appreciated!