pvsadm
asked on
Dropping ALL indexes (incl PK) on a table
is there a way to drop all indexes (PK + indexes) on a table? is there a stored procedures? i don't know the names of the indexes... i want to use it in my program to clear a table of the indexes and rebuild new indexes...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
*) capture current info using EXEC sp_helpindex 'tablename'
*) drop non-clustered indexes
*) drop clustered index (if any)
*) recreate non-clustered indexes
*) recreate clustered index (if any)