Wednesday, December 29, 2010

DB Sizes & Space Used ... sp_spaceused

Per DB: sp_helpdb

Per object: EXEC sp_spaceused 'sys_users'

For all objects in a DB: EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"

sp_MSforeachtable is and undocumented system proc that lets you do it easily.

I suggest dumping the output to a flat file and cleaning in excel ([Query] [Results to] [Results to file]).