Is there a way to remove all attribute indexes on a particular feature class using python- without naming each one specifically? I have a script that I can run, but it names each index separately. I would like to remove all indexes with one command if possible. Thank you Eric V
Create a list of indexes for a table using Describe and then delete them using the geoprocessing tool. Since you can supply a list, then that is done in one step. Ignore the first index on the objectid.
arcpy.env.workspace = "e:/crs/mobile/mobile.gdb"
dsc = arcpy.Describe("sap")
lstIndex = [i.name for i in dsc.Indexes][1:]
print lstIndex
arcpy.management.RemoveIndex("sap",lstIndex)