January 31, 2008 at 6:59 am
Comments posted to this topic are about the item Identify Large Tables
January 15, 2009 at 1:05 pm
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?
Thanks
January 15, 2009 at 1:26 pm
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))
Thanks again.
February 13, 2009 at 1:12 pm
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.
March 26, 2012 at 12:04 pm
here is another way to do this without a cursor
May 11, 2016 at 7:01 am
Thanks for the script.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply