Why does de-fragmentation of database files at the operating system level skip MDF files? SQL Server has them open, so stop the services first.
How to Read a T-SQL Syntax Diagram
Read a T-SQL syntax diagram without guessing: brackets mean optional, braces mean required choices, pipes separate options, and dots repeat items.
SQL SERVER – 2005 Find Table without Clustered Index – Find Table with no Primary Key
A query on sys.indexes to find every table without clustered index in a database, why heaps can slow you down, and how to pick a clustered key.
SQL SERVER – Change Default Fill Factor For Index
The Default Fill Factor in SQL Server is 0. Change it with sp_configure to leave free space on index pages and reduce page splits. I like mine at 90.
SQL SERVER – 2005 Comparison EXCEPT operator vs. NOT IN
The EXCEPT operator returns distinct rows from the left query with no match on the right, just like NOT IN. Both give the same plan, but EXCEPT reads simpler.
SQL SERVER – Disable Index – Enable Index – ALTER Index
When DTS, BCP or BULK INSERT needs an index out of the way, I prefer to disable index with ALTER INDEX and enable it again with REBUILD. AdventureWorks example.
How the Main System Views Connect
Learn how the main system views connect through object_id, schema_id, index_id, and column_id so catalog joins stay accurate.







