Hi All,
I am trying to use arcpy on ArcCatalog 10.2.1 to delete some version on our sql database. when I use the function arcpy.DeleteVersion_management(connection, version.name), i get an error "ERROR 000301: The workspace is of the wrong type". The connection is to a .sde file and the user has permission to delete all versions.
Thank you for your help
Below is my script:
arcpy.env.Workspace = r'C:\Users\JBurgos\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\ArcGIS to BELNetwork.sde'
defaultVersion = "sde.DEFAULT"
connection = arcpy.env.Workspace
versionName = "WR456_DN560"
arcpy.ClearWorkspaceCache_management()
# Execute DeleteVersion
for version in arcpy.da.ListVersions(connection):