Monthly Archives: October 2012

Don’t believe everything you read: Truncate table is not logged

Actually I’m not sure if anyone still believes this anymore. If you read the BOL description carefully it states that truncate de-allocates the pages rather than deleting the rows – meaning only the de-allocations are logged – resulting in far … Continue reading

Posted in Database Theory, SQL Server, T-SQL | 1 Comment

Quick tip: Count table rows in a database, and locate those rows in the data files.

Here are a couple of quick database and table level queries that I have found useful lately. How many rows in each table of a database? The first temptation with this one was to use something like sp_MSforeachtable with a … Continue reading

Posted in Database options, Database Theory, SQL Server, T-SQL | Leave a comment

Querying database usage

A question that a DBA will often be asked is what databases are actively being used on my SQL Server? We get asked it all the time, usually as part of a consolidation or rationalisation project. My solution to this … Continue reading

Posted in Database options, SQL Server, T-SQL | Leave a comment