views:

93

answers:

3

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

+5  A: 

Try the stored procedure:

exec sp_spaceused TableName

For all tables you could use:

exec sp_Msforeachtable 'exec sp_spaceused'
Yoda
And how to show sizes from the all tables?
jitm
forgot to remove table name there for a second ^^
Yoda
+1  A: 

You can use the sp_spaceused system procedure:

EXECUTE sp_spaceused 'YourTable'
AdaTheDev
A: 

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';

RIDDHI