Unregister As Versioned (Data Management)

Summary

Unregisters an enterprise geodatabase dataset as versioned.

Usage

  • The input dataset must be from a database connection established as the data owner.

  • An exclusive lock is required on the dataset.

  • Unregistering a branch versioned dataset without first posting all named versions to the default version may result in a loss of edits.

  • Unregistering a traditional versioned dataset without first compressing the geodatabase may lead to loss of edited data.

Parameters

LabelExplanationData Type
Input Dataset

The name of the dataset to be unregistered as versioned.

Table View; Feature Dataset
Do not run if there are versions with edits
(Optional)

Specifies whether edits made to the versioned data will be maintained.

  • Checked—When there are outstanding edits that could be lost, the tool will fail. Outstanding edits include edits in the delta tables (traditional versioned dataset) and edits in named versions (branch versioned dataset). This is the default. For traditional versioned datasets, do not use this option when compressing edits from the Default version in the Compress all edits in the Default version into the base table parameter.
  • Unchecked—When there are outstanding edits, the tool will delete the edits. For traditional versioned datasets, use this option when compressing edits from the Default version in the Compress all edits in the Default version into the base table parameter.
Boolean
Compress all edits in the Default version into the base table
(Optional)

Specifies whether edits will be compressed and unused data will be removed. This option is ignored if the Do not run if there are versions with edits parameter is checked.

This parameter is only applicable for traditional versioned datasets.

  • Checked—Edits in the Default version will be compressed to the base table.
  • Unchecked—Any edits remaining in the delta tables will not be compressed. This is the default.

Boolean

Derived Output

LabelExplanationData Type
Unregistered Dataset

The unregistered dataset.

Table View; Feature Dataset

arcpy.management.UnregisterAsVersioned(in_dataset, {keep_edit}, {compress_default})
NameExplanationData Type
in_dataset

The name of the dataset to be unregistered as versioned.

Table View; Feature Dataset
keep_edit
(Optional)

Specifies whether edits made to the versioned data will be maintained.

  • KEEP_EDITWhen there are outstanding edits that could be lost, the tool will fail. Outstanding edits include edits in the delta tables (traditional versioned dataset) and edits in named versions (branch versioned dataset). This is the default. For traditional versioned datasets, do not use this option when compressing edits from the Default version in the compress_default parameter.
  • NO_KEEP_EDITWhen there are outstanding edits, the tool will delete the edits. For traditional versioned datasets, use this option when compressing edits from the Default version in the compress_default parameter.
Boolean
compress_default
(Optional)

Specifies whether edits will be compressed and unused data will be removed. This option is ignored if the keep_edit parameter is set to KEEP_EDIT.

This parameter is only applicable for traditional versioned datasets.

  • COMPRESS_DEFAULTEdits in the Default version will be compressed to the base table.
  • NO_COMPRESS_DEFAULTAny edits remaining in the delta tables will not be compressed. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_dataset

The unregistered dataset.

Table View; Feature Dataset

Code sample

UnregisterAsVersioned example (stand-alone script)

The following stand-alone script demonstrates how to use the UnregisterAsVersioned function to unregister a dataset as versioned.

# Name: UnregisterAsVersioned_Example.py
# Description: Unregisters a dataset as versioned
# Author: ESRI

# Import system modules
import arcpy

# Set local variables
datasetName = "c:/whistler@prod.sde/prod.GDB.ctgFuseFeature"

# Execute UnregisterAsVersioned
arcpy.UnregisterAsVersioned_management(datasetName,
                                       "NO_KEEP_EDIT",
                                       "COMPRESS_DEFAULT")

Environments

Related topics