Tuesday, November 6, 2012

Get the table size in SQL Server

Last week I noticed that our TFS database size was getting out-of-control. So I decided to have a look at what tables consumed the most disk space.

SQL Server makes this easy by providing a built-in stored procedure that shows the size of a table, including the size of the indexes:

sp_spaceused ‘Tablename’

A sample:

image

No comments: