Why does DBCC SHRINKFILE take so long when index rebuilds run faster? It is single threaded. Rebuild indexes first and the shrink takes less time.
SQL SERVER – 2005 -Track Down Active Transactions Using T-SQL
Want to track down active transactions in your database? One simple DMV query on sys.dm_tran_session_transactions returns them in SQL Server 2005.
SQL SERVER – Introduction to Log Viewer
The SQL Server 2005 Log Viewer shows SQL Server error logs, Agent logs, Database Mail and Windows event logs in one place, ready to filter and export.
SQL SERVER – Clear SQL Server Memory Caches
Need to clear SQL Server memory caches on a production server you cannot restart? Three DBCC commands free up memory by cleaning the cache.
Splitting a Big Table Into Equal Key Ranges for Batch Work
Equal-width key ranges fail when ids have gaps. NTILE cuts by row count instead, so every worker gets a fair share of the table.
Change Service Broker Port: Drop and Recreate the Endpoint
Service Broker hit error 9692 because another application used its port. To change Service Broker port, drop the endpoint and create it again on a new port. Both scripts are here.







