I'm working on a script that will empty my SDE database of all data. How would I go about deleting features from feature classes using ArcPy?
I have an SDE connection created with a user that should have delete privileges. So far I've tried using the arcpy.DeleteFeatures_management from code and from the Delete Features toolbox in data management.
My DB has SDE feature datasets with SDE feature classes inside.
The Delete Features tool box errors out with:
ERROR 000732: Input Features: "Dataset Database Connections\Connection to sde.sde\User.MyFeatureDataset\User.MyFeatureClass" does not exist or is not supported.
The documentation is not really helping me. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000036000000
"If you want to delete all features from an ArcSDE feature class, use this tool against the ArcSDE feature class (not a layer) without a selection in order to perform a database truncate rather than a row by row deletion of features to delete all the features. The database truncate operation is much faster when deleting all the features in a feature class."
Have you tried using both the layer and the feature class? Also, have you tried deleting a feature class that is not in a feature dataset to see whether that works?
– PolyGeo Apr 18 '12 at 22:38