Can anyone provide the script for rebuilding and reindexing the fragmented index when 'avg_fragmentation_in_percent' exceeds certain limits without using a cursor?
+2
A:
Try this:
ALTER INDEX __NAME_OF_INDEX__ ON __NAME_OF_TABLE__ REBUILD
ALTER INDEX __NAME_OF_INDEX__ ON __NAME_OF_TABLE__ REORGANIZE
KM
2009-07-06 13:43:10
+1
A:
I have found the following script is very good at maintaining indexes, you can have this scheduled to run nightly or whatever other timeframe you wish.
Lima
2009-07-10 14:58:23