Remove Attribute Index (Data Management)

License Level:BasicStandardAdvanced

Summary

This tool deletes an attribute index from an existing table, feature class, shapefile, coverage, or attributed relationship class.

Attribute indexes are used by ArcGIS to quickly locate records that match an attribute query.

Usage

Syntax

RemoveIndex_management (in_table, index_name)
ParameterExplanationData Type
in_table

The table containing the index or indexes to be deleted. Table can refer to an actual table, a feature class attribute table, or an attributed relationship class.

Mosaic Layer; Raster Catalog Layer; Raster Layer; Table View
index_name
[index_name,...]

The name of the index or indexes to be deleted.

String

Code Sample

Remove Index Python Example (Python Window)

The following code demonstrates how to use RemoveIndex function in a Python interactive window.

import arcpy
arcpy.env.workspace = "C:/data/input/indices.gdb"
arcpy.RemoveIndex_management("lakes", ["IndexA", "IndexB"])
Remove Index Python Example 2 (Stand-alone Script)
import arcpy
 
# Set a default workspace
arcpy.env.workspace = "c:/data"
 
try:
    # Remove 2 indexes for the Feature Class below.
    arcpy.RemoveIndex_management ("/county.gdb/lots", "indexa;indexb")	
 
except Exception, e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "Line %i" % tb.tb_lineno
    print e.message

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013