Basics of Statistics in SQL Server 2005 –

I had a table that was too large to get a count of. I tried Select Count(*) from {Table} but the query didn’t want to come back very quickly.

Another way to get the size is to get statistical information on the primary key. You can do sp_helpstats ‘{Schema}.{Table}’, ‘ALL’ to get a list of objects with statistical information. Find the primary key, then do DBCC SHOW_STATISTICS(‘{Schema}.{Table}’, {value of statistics_name column from previous query}

This entry was posted in Development, Uncategorized and tagged , , , , . Bookmark the permalink.