Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is the normal process using ArcCatalog :

enter image description here

I want to automate this process using sdeLayer or any tools - does anybody have an idea as to how to do it?

there is an application sdelayer (sdelayer.exe) in "C:\Program Files\ArcGIS\ArcSDE\pgexe\bin" i want to create a command line to register featurelayer

sdelayer -o register -l <table,column> -e <entity_mask> -t <storage_type>
{[-C <row_id_column>[,{SDE|USER}[,<min_ID>]]]} [Spatial_Index]
[-E <{empty | xmin,ymin,xmax,ymax}>] [{-R <SRID> | [Spatial_Ref_Opts]}]
[-S <layer_description_str>] [-k <config_keyword>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-q]
share|improve this question
database name : sde user : mr password : test feature layer name : parcel parcel column geometry : shape port postges : 5433 user PostgreSQL/arcsde : postgres password PostgreSQL/arcsde : test2 server : localhost – Mounaim Oct 11 '13 at 9:44
i want to know that why registering as versioned is necessary. Because if it helps to track a record of delete and add ( Delta Tables), then what is the function of checking or uncheking the option of " Moving the edits into a base table"...? – user36353 Aug 28 '14 at 8:02
up vote 3 down vote accepted

You got the wrong sde* command. sdelayer is for the spatial data in a SDE table. The sdetable column is for working on the table, such as adding/removing columns, adding indexes, etc.

You can register a table for SDE with something like this:

sdetable -o register -t railroads -i 5151 -u scott -p tiger -s localhost

When you want to have it versioned in the normal way, use the -V switch:

sdetable -o register -t railroads [...] -V MULTI

And when you want to move edits to base, use hybrid:

sdetable -o register -t railroads [...] -V HYBRID

My table has a column ID, and it needs to be the OBJECTID column, so I specify:

sdetable -o register -t railroads [...] -V HYBRID -C sde -c ID

share|improve this answer

Try using Register As Versioned (Data Management) GP tool. This GP tool can be used in a Python script:

import arcpy
sde_workspace = r"C:\databasegeo.sde" #path to your .sde file connection on disk
fcs_list = arcpy.ListFeatureClasses()
for fc in fcs_list:
    arcpy.RegisterAsVersioned_management(fc, "EDITS_TO_BASE")
share|improve this answer
please @Alex do you know how to do it with ? Dim toolR As ESRI.ArcGIS.DataManagementTools.RegisterAsVersioned = New ESRI.ArcGIS.DataManagementTools.RegisterAsVersioned – Mounaim Oct 11 '13 at 10:10
@AbdelMounaimTAOUSSI, do you want to use the GP tool in your VB code? I guess you could just use ISQLSyntax to get the name of the owner and IVersionedObject to register a featureclass (and other household work) as versioned.…. Unfortunately, cannot provide any specific details since I don't work with VB that much. – Alex Tereshenkov Oct 11 '13 at 10:18
there is an application sdelayer (sdelayer.exe) in "C:\Program Files\ArcGIS\ArcSDE\pgexe\bin" i want to create a command line to register featurelayer – Mounaim Oct 21 '13 at 11:03
You cannot register a feature class/table as versioned by using ArcSDE Commands. They are not aware of geodatabase behaviour. You need to use GP tool/Python/ArcObjects. sdelayer.exe has register option which is for registering the table with SDE, not to register as versioned. – Alex Tereshenkov Oct 21 '13 at 11:54
I bet you can use IVersionedObject in ArcObjects to iterate through multiple feature classes. If not, then use Python or ModelBuilder (it has Iterate Feature Classes iterator). – Alex Tereshenkov Oct 21 '13 at 13:54

solved (thank you @Alex ) so this is a sample code that i used to register one feature class so after that we can iterate feature class to register them:

   Public featureLayer1 As IFeatureLayer = New FeatureLayerClass
   featureLayer1.FeatureClass = featureWorkspace.OpenFeatureClass("parcels")
   Dim pVersionedObject As IVersionedObject

   pVersionedObject = featureLayer1.FeatureClass

     'Determining if the feature class is registered as versioned
     If pVersionedObject.IsRegisteredAsVersioned = False Then
        'regester feature as versionned 
     End If 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.