Syntax

The enterprise geodatabase that contains the parent version and will contain the new version.

Workspace

parent_version

The geodatabase, or version of a geodatabase, on which the new version will be based.

String

version_name

The name of the version to be created.

String

access_permission

(Optional)

The permission access level for the version to protect it from being edited or viewed by users other than the owner.

PRIVATE —Only the owner or the geodatabase administrator can view and modify the
version or versioned data.

PUBLIC —Any user can view the version. Any user who has been granted
read/write (update, insert, and delete) permissions on datasets can
modify datasets in the version.

PROTECTED —Any user can view the version, but only the owner or the
geodatabase administrator can edit the version or datasets in the version.

String

Derived Output

Name

Explanation

Data Type

out_workspace

The updated input workspace.

Workspace

Code sample

CreateVersion example (stand-alone script)

The following stand-alone script demonstrates how to create a new version.

# Description: Creates a new version# Import system modulesimportarcpy# Set local variablesinWorkspace="c:/Connections/whistler@gdb.sde"parentVersion="dbo.DEFAULT"versionName="myVersion"# Execute CreateVersionarcpy.CreateVersion_management(inWorkspace,parentVersion,versionName,"PUBLIC")