I need to update one field, AnnotationClassID, for all annotation in our versioned SDE. There are close to a million records in a half dozen feature classes. What are the ramifications of using the arcpy.da module to do this task? Curious to know how others have handled this task. Below is a basic sketch of what I had in mind. Many Thanks!
import arcpy import os fc = r'X:\Database connection to vm-sql3.sde\Anno0100scale' workspace = os.path.dirname(fc) edit = arcpy.da.Editor(workspace) edit.startEditing(False, True) edit.startOperation() cursor = arcpy.UpdateCursor(fc, ["AnnotationClassID","SymbolID"]) for row in cursor: row.AnnotationClassID = row.SymbolID cursor.updateRow(row) edit.stopOperation() edit.stopEditing(True)
Solved! Go to Solution.
Hi Adam,
Using the arcpy.da module will be much faster. Ex:
cursor = arcpy.da.UpdateCursor(fc, ["AnnotationClassID","SymbolID"]) for row in cursor: row[0] = row[1] cursor.updateRow(row)
Before running this script, I would recommend creating a database backup. Also, after the edits are complete, it will be best to perform a reconcile/post, compress, and analyze of the datasets.
great
Hi Adam,
Using the arcpy.da module will be much faster. Ex:
cursor = arcpy.da.UpdateCursor(fc, ["AnnotationClassID","SymbolID"]) for row in cursor: row[0] = row[1] cursor.updateRow(row)
Before running this script, I would recommend creating a database backup. Also, after the edits are complete, it will be best to perform a reconcile/post, compress, and analyze of the datasets.