jitm
jitm

Reputation: 2597

Physical size of MS SQL Table

How to find what the physical size of table in MS Sql 2005? Is it possible using sql query or not? Thanks.

Upvotes: 16

Views: 16159

Answers (4)

twleblanc
twleblanc

Reputation: 180

You can also use the built-in report (in 2008 at least).

Right-click the database in MS-SMS then select Reports > Standard Reports > Disk Usage by Table from the context menu.

The results are exportable to Excel.

Upvotes: 10

Matt
Matt

Reputation: 4117

Try the stored procedure:

exec sp_spaceused TableName

For all tables you could use:

exec sp_Msforeachtable 'exec sp_spaceused ''?'''

Upvotes: 30

RPL
RPL

Reputation: 79

SELECT table_schema, table_name, ROUND(data_length/1024/1024,2) total_size_mb FROM information_schema.tables WHERE table_name = 'emp_master' AND table_schema = 'emp_database';

Upvotes: 0

AdaTheDev
AdaTheDev

Reputation: 147224

You can use the sp_spaceused system procedure:

EXECUTE sp_spaceused 'YourTable'

Upvotes: 3

Related Questions