Is shrinking NDF and MDF files safe? A reader asked if it causes data loss. It does not, but I explain why shrinking them is often not a good idea.
SQL SERVER – 2008 – 2005 – Find Longest Running Query – TSQL – Part 2
An updated script to find the longest running query in SQL Server 2005 and 2008, with the divide by zero error fixed and time now shown in milliseconds.
SQL SERVER – Find Number of Rows and Disk Space Reserved – Using sp_spaceused Interesting Observation
sp_spaceused shows the row count of a table and the disk space reserved. Here is why its numbers looked wrong on AdventureWorks and how @updateusage fixed them.
SQL SERVER – 2008 – 2005 – Find Longest Running Query – TSQL
My company owner asked which query runs longest and I found no ready script, so I wrote one: the Longest Running Query with its average and maximum time.
SQL SERVER – Check Database Integrity for All Databases of Server – DBCC CHECKDB
A quick script to check database integrity for all the databases on a server with DBCC CHECKDB and sp_msforeachdb, and how to read its output.
SQL SERVER – Refresh Database Using T-SQL
Can you refresh database in Object Explorer using a T-SQL query? No. But if cached objects changed, DBCC commands can clear the cache for you.
SQL SERVER – 2008 – Interview Questions and Answers Part 8
SQL Server 2008 Interview Questions and Answers Part 8 starts with Data Compression: how row compression and page compression work and save space.







