Get Table Unused Space

Posted on Updated on

To find out how much space is being used in a table you’ll need to use the system’s sp_spaceused stored procedure.

EXEC sp_spaceused N’dbo.orders’

The following are the options:

name: Table name for which space usage information was requested

rows: Number of rows existing in the table

reserved: Total amount of reserved space for table data and indexes

data: Amount of space used by table data

index_size: Amount of space used by table indexes

unused: Total amount of space reserved for table but no yet used