Dear all
How can I know, via SQL, the access level of a Version (Public, Private or Protected)? I took a look to the VERSIONS table but I can't figure how to obtain this info.
I want to replicate the same version structure in a new geodatabase and I would like to create dynamically the "CreateVersion_Management..." arcpy commands using the info. in the SDE GDB tables.
Thank you in advance
Jesús de Diego
Solved! Go to Solution.
The access level of the version is stored in the table's status column. To work with this column you would need to know a version that is public, private, protected so you can identify the status number for each.
System tables of a geodatabase in SQL Server—Help | ArcGIS for Desktop
However, if you are planning on using CreateVersion_management, an easier approach would be to use the Data Access module to list the version objects. Then you can use the version access property.
ListVersions—Data Access module | ArcGIS for Desktop
Version—Data Access module | ArcGIS for Desktop
Sample:
import arcpy oldgdb = 'Database Connections\old.sde' newgdb = 'Database Connections\new.sde' for ver in arcpy.da.ListVersions(oldgdb): arcpy.CreateVersion_management(newgdb, ver.parentVersionName, ver.name, ver.access)
The access level of the version is stored in the table's status column. To work with this column you would need to know a version that is public, private, protected so you can identify the status number for each.
System tables of a geodatabase in SQL Server—Help | ArcGIS for Desktop
However, if you are planning on using CreateVersion_management, an easier approach would be to use the Data Access module to list the version objects. Then you can use the version access property.
ListVersions—Data Access module | ArcGIS for Desktop
Version—Data Access module | ArcGIS for Desktop
Sample:
import arcpy oldgdb = 'Database Connections\old.sde' newgdb = 'Database Connections\new.sde' for ver in arcpy.da.ListVersions(oldgdb): arcpy.CreateVersion_management(newgdb, ver.parentVersionName, ver.name, ver.access)
Hi Christian
Values in STATUS field in VERSIONS table change once a reconclie/post has been done:
However, arcpy version object works fine for me!
Thanks
Jesús de Diego
Glad this worked for you!