Skip To Content

Delete Version

Summary

Deletes the specified version from the input enterprise, workgroup, or desktop geodatabase.

Usage

  • Only the version's owner can delete the version.

  • A parent version cannot be deleted until all dependent child versions are deleted.

  • Versions are not affected by changes occurring in other versions of the geodatabase.

  • Versioning tools only work with enterprise, workgroup, and desktop geodatabase data. Personal and file geodatabases do not support versioning.

  • This tool supports deleting a branch version through the version service.

Syntax

DeleteVersion_management (in_workspace, version_name)
ParameterExplanationData Type
in_workspace

Specifies the database connection file to the enterprise, workgroup, or desktop geodatabase containing the version to be deleted. The default is to use the workspace defined in the Current Workspace environment.

For branch versioning, use a feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer) or a feature layer portal item.

Workspace
version_name

Specifies the name of the version to be deleted.

String

Code sample

DeleteVersion example (stand-alone script)

The following stand-alone script demonstrates how use the DeleteVersion tool to delete a version.

# Description: Deletes a version

# Import system modules
import arcpy

# Set local variables
inWorkspace = "c:/Connections/whistler@gdb.sde"
versionName = "myVersion2"

# Execute DeleteVersion
arcpy.DeleteVersion_management(inWorkspace, versionName)

Environments

Licensing information

  • ArcGIS Desktop Basic: No
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics