[GIS] Delete a feature data set in SDE 10 programmatically

arcobjectsdatabaseenterprise-geodatabasespatial-database

Is there a way to delete a feature data set and all of its feature classes programmatically either by using custom code or pre-existing command line tools?

There is a tool provided by SDE called sdetable.exe but i'm not sure if this will do the trick.

My feature data sets are setup in ArcSDE via scripts which call a custom executable that imports XML workspaces. I'd like a way to delete the feature data sets that the XML workspaces import because when I re-run the scripts I get things like this:

Underlying DBMS error [ORA-00972: identifier is too long

(VITD.Surface_Drainage_Channel_Area_1)]

The '_1' is appended because there is already a feature class named Surface_Drainage_Channel_Area. So I'd like to have my scripts first drop the VITD feature data set and all of its feature classes before importing my XML workspace XML document that creates it.

Best Answer

sdetable (like all SDE command line tools) does not recognize/understand the Geodatabse. Because a feature dataset is a geodatabase object, you cannot use sdetable to delete it.

You'll need to stick with an ArcObjects based client to do a clean delete. The easiest way would be to use the delete geoprocessing tool.

Related Question