Version access level via SQL

1359
3
Jump to solution
03-09-2016 06:17 AM
Highlighted
Occasional Contributor II


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

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Contributor

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

versions.jpg

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)

   

View solution in original post

3 Replies
Highlighted
Esri Contributor

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

versions.jpg

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)

   

View solution in original post

Highlighted
Occasional Contributor II

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

Reply
0 Kudos
Highlighted
Esri Contributor

Glad this worked for you!

Reply
0 Kudos