Delete Multiple (Data Management)

Summary

Permanently deletes multiple data items of the same or different data types. All types of geographic data supported by ArcGIS, as well as toolboxes and workspaces (folders and geodatabases), can be deleted. If a specified item is a workspace, all contained items will also be deleted.

Usage

  • To delete data items of the same name in the same workspace but with different data types, you must also specify their data type. The tool provides all appropriate options in the Input Data Element parameter's Data Type choice list.

  • Feature classes and tables participating in a network analysis dataset or a topology cannot be deleted.

  • Deleting a relationship class deletes the row corresponding to that relationship from the relationship table.

  • Deleting a mosaic dataset will only delete the mosaic dataset. To delete a mosaic dataset in its entirety—including any tables in the database and, optionally, any overviews or caches created with it—use the Delete Mosaic Dataset tool

  • This tool does not delete hosted feature services.

  • Data currently in use in another ArcGIS application cannot be deleted.

  • This tool can be used to delete data in the memory workspace. The memory workspace itself cannot be deleted.

  • Deleting a layer removes only the layer; its source data is not deleted.

  • Deleting a database connection file removes the shortcut to the database, it does not delete the enterprise database.

  • Deleting a shapefile also deletes ancillary files such as the metadata, projection, and index files.

  • Deleting a folder moves the folder to the system recycle bin, where it can be restored or permanently deleted.

Parameters

LabelExplanationData Type
Input Data Element

The input data that will be deleted.

The data type is necessary in the event of a name conflict between data types. For example, a geodatabase can contain a feature class with an identical name to a relationship class. In this case, specify the relevant keyword.

  • FeatureClass—In the event of duplicate names, the feature class will be used.
  • FeatureDataset—In the event of duplicate names, the feature dataset will be used.
  • MosaicDataset—In the event of duplicate names, the mosaic dataset will be used.
  • ParcelFabric—In the event of duplicate names, the parcel fabric will be used.
  • RelationshipClass—In the event of duplicate names, the relationship class will be used.
  • Topology—In the event of duplicate names, the topology will be used.
Value Table

Derived Output

LabelExplanationData Type
Delete succeeded

Specifies whether the delete was successful.

Boolean

arcpy.management.DeleteMultiple(in_data)
NameExplanationData Type
in_data
[[Input Data Element, {Data Type},...]

The input data that will be deleted.

The data type is necessary in the event of a name conflict between data types. For example, a geodatabase can contain a feature class with an identical name to a relationship class. In this case, specify the relevant keyword.

  • FeatureClass—In the event of duplicate names, the feature class will be used.
  • FeatureDataset—In the event of duplicate names, the feature dataset will be used.
  • MosaicDataset—In the event of duplicate names, the mosaic dataset will be used.
  • ParcelFabric—In the event of duplicate names, the parcel fabric will be used.
  • RelationshipClass—In the event of duplicate names, the relationship class will be used.
  • Topology—In the event of duplicate names, the topology will be used.
Value Table

Derived Output

NameExplanationData Type
out_results

Specifies whether the delete was successful.

Boolean

Code sample

DeleteMultiple example (Python window)

The following Python window script demonstrates how to use the DeleteMultiple function in immediate mode.

import arcpy
arcpy.management.DeleteMultiple(
    in_data=[[r'C:\dataToDelete\target.gdb\fabric1', 'ParcelFabric'],
             [r'C:\dataToDelete\ctg83.gdb\ctg83FDS', 'Topology']]
)
DeleteMultiple example (stand-alone script)

The following Python window script demonstrates how to use the DeleteMultiple function in a stand-alone script.

import arcpy

arcpy.env.overwriteOutput = True
arcpy.management.Copy(r"D:\deleteMulti\dataToDelete", r"C:\dataToDelete")
arcpy.env.workspace = r"C:\dataToDelete"
arcpy.management.DeleteMultiple(
    in_data=[['C:\dataToDelete\convertlabels.gdb\points', 'FeatureClass'],
             ['C:\dataToDelete\deleteMultiple.gdb\issue7725', 'FeatureDataset'],
             ['C:\dataToDelete\RelationshipData.gdb\Destination2_really_long_name', 'RelationshipClass'],
             ['C:\dataToDelete\SMALL.gdb\Small_1', 'ParcelFabric'],
             ['C:\dataToDelete\addRaster_colorBal.gdb\colorCorrected', 'MosaicDataset']]
)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics