The BOL script to defragment all indexes in a database above a declared threshold failed with Msg 2501. I fixed the missing schema prefix so it runs on SQL Server 2005.
SQL SERVER – Index Reorganize or Index Rebuild
When should you use Index Reorganize and when Index Rebuild? I get this question a lot, so here is a pointer to my earlier post that explains both with T-SQL.
SQL SERVER – 2005 – Find Unused Indexes of Current Database
A simple but accurate SQL Server 2005 script to find unused indexes in the current database, since unused indexes slow down INSERT and UPDATE statements.
SQL SERVER – 2005 – Display Fragmentation Information of Data and Indexes of Database Table
How do you find Fragmentation Information for a table in SQL Server 2005? DBCC SHOWCONTIG has limits, so I use sys.dm_db_index_physical_stats instead.
SQL SERVER – Difference Between Index Rebuild and Index Reorganize Explained with T-SQL Script
Index Rebuild drops and recreates the index, while Index Reorganize reorders the leaf nodes. Rebuild above 40% fragmentation, reorganize between 10% and 40%.
SQL SERVER – Enabling Clustered and Non-Clustered Indexes – Interesting Fact
When enabling clustered and non-clustered indexes, order matters: enabling the clustered index does not enable the others, but rebuilding all indexes does.







