Comments posted to this topic are about the item Identify Large Tables
Jessie, thanks very much for this, but I found something rather interesting, perhaps you can explain.
The query identified a table with row count = 154 and phys_size_KB = 26760. However, when I selected all rows I got a count of 202 is this because the statistics are out of date?
This table has a high unused allocation of 99%. I calculated this based on unused/reserved. I just ran a shrink on the database and it does not seem to help. Can you explain this?
Jessie, I did some searching and found that you should add a param to the sp_spaceUsed proc. This will give you a more accurate value.
EXEC sp_spaceused @User_Table_Name,'true'
I also used this to get the unused KB's for each table
Unused_KB = CONVERT(int, LEFT([unused], PATINDEX('% KB', [unused]) - 1))
Doug, thanks for the responses. I updated the code by adding the 'TRUE' parameter to the sp_spaceused call (and gave you credit for that - I submitted the updated version and it should be published soon). I noticed that it slowed down performance the first time it ran, and then ran instantaneously on subsequent executions.
here is another way to do this without a cursor
Thanks for the script.
Viewing 6 posts - 1 through 5 (of 5 total)