Get SQL Table Size - Table and Index Space - Row Count

This Script will return the row count and the amount of disk space that each table uses within a specifed database.
When returning total disk space used, it breaks it up into 3 categories...
1. The amount used by data
2. The Amount used by indexes
3. The amount of unused space
Hope this helps you and please vote.

Wonderful! Very helpful.There is one thing. In SQL 2005 the space columns are character type and have KB stuck on the end. Therefore the sort by size does not work.(If this comment was disrespectful, please report it.)

Thanks for helping to "Keep the Planet Clean".This comment should be removed because:

I realize this script is going back 7 years now but It's pretty fast on my sql server 2000 machine so I'd like to use it. Just wondering if you caould tell me what the column 'Unused Space' represents. for some tables I have a positive, some a zero and a few have a negative number.Thanks! (If this comment was disrespectful, please report it.)

Thanks for helping to "Keep the Planet Clean".This comment should be removed because:

Add Your Feedback

Your feedback will be posted below and an email sent to
the author. Please remember that the author was kind enough to
share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular code, please
click here instead.)