Select to view content in your preferred language

Script to Discover Versioned Tables?

491
2
Jump to solution
08-15-2012 12:25 PM
847396730
Frequent Contributor
Hello!  I'd like a list of tables in my SDE which are versioned, and a list of tables which are not versioned.  I know I can see whether or not a table is versioned this way: Feature Class Properties > General Tab > Versioning information, but how can I write a script that would discover that for me? 

I don't see these properties available via the Describe function--any thoughts on how to proceed?
Thanks!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RussellBrennan
Esri Contributor
This should do the trick:
import arcpy  arcpy.env.workspace = r'Database Connections\Test.sde'  dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters() + arcpy.ListDatasets("", "Feature")  for dataset in dataList:   desc = arcpy.Describe(dataset)   if desc.isVersioned:     print desc.name

View solution in original post

0 Kudos
2 Replies
RussellBrennan
Esri Contributor
This should do the trick:
import arcpy  arcpy.env.workspace = r'Database Connections\Test.sde'  dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters() + arcpy.ListDatasets("", "Feature")  for dataset in dataList:   desc = arcpy.Describe(dataset)   if desc.isVersioned:     print desc.name
0 Kudos
847396730
Frequent Contributor
Thanks so much!  I didn't dig far enough--Dataset was the one property group I didn't check.  Thanks again!
0 Kudos