I have several hundred geodatabase feature classes which all have the exact same fields. I need to go through each of those feature classes and delete any records which match an SQL query (the same SQL query can be applied to all the feature classes). Alternatively, I could export them all to new feature classes, keeping the records I want. In ArcCatalog I can export them singly using an SQL query to specify which records get exported, but the SQL statement option isn't available when you want to export multiple layers simultaneously (using "Feature Class to Geodatabase (multiple)").
I would try doing this using the Select (Analysis) tool:
Extracts features from an input feature class or input feature layer, typically using a select or Structured Query Language (SQL) expression and stores them in an output feature class.
in batch mode:
To use batch, right-click a tool and click Batch. This opens the batch dialog box with one row of the batch grid
One way to automate the processing of this would be with Python by working through a list of the feature classes, and the using an updatecursor/deleteRow statement to delete the unneeded records.
import arcpy workspace = r"c:\yourworkspace\yourgeodatabase.gdb" #assuming file geodatabase arcpy.env.workspace = workspace #Part 1 -- create list of feature classes in your geodatabase... #assuming all featureclasses within the geodatabase are of interest for the query -- otherwise specify a wildcard below featureclasslist = arcpy.ListFeatureClasses() #now run a loop on feature classes in the list for featureclass in featureclasslist: #Part 2 -- deleting the records specified in your sql query. There are two approaches: # option1: your_query = " \"yourfield\" = 'your_value' " #enter your sql query here rows = arcpy.UpdateCursor(featureclass, your_query) for row in rows: rows.deleteRow(row) # or option 2 rows = arcpy.UpdateCursor(featureclass) for row in rows: if row.getValue("Yourfield") == 'your_value': rows.deleteRow(row)
More here on listing featureclasses: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001n000000
and on the updatecursor/deleteRow statement: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000