My general stuff. This will generally include computer related information, but may also contain general rantings on my part.

Friday, March 19, 2010

Reporting on space used in a SQL database

I had the need today to look at a database and quickly identify which tables were taking up the most space. Since there are over 400 tables, doing this by hand wasn't going to work. Below is the TSQL script I created based on the sp_spaceused stored procedure to catalog the data and output it into a result set.