Created
October 30, 2015 20:42
-
-
Save dersteppenwolf/0c363e79590ace14898d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import os | |
#"unregistering as versioned" multiple datasets using arcpy | |
try: | |
conn_path = "c:/temp/RUTACONN.SDE" | |
datasets = ["DATASET_01", "DATASET_02", "DATASET_03", "DATASET_04", "DATASET_05"] | |
for dataset in datasets: | |
dataset_path = os.path.join(conn_path,dataset ) | |
print dataset_path | |
datasetVersioned = arcpy.Describe(dataset_path).isVersioned | |
print datasetVersioned | |
if datasetVersioned: | |
try: | |
arcpy.UnregisterAsVersioned_management(dataset_path,"NO_KEEP_EDIT", "COMPRESS_DEFAULT") | |
except Exception as e: | |
print arcpy.GetMessages() | |
except Exception as e: | |
print arcpy.GetMessages() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment