开发者

Physical size of MS SQL Table

开发者 https://www.devze.com 2022-12-30 12:59 出处:网络
How to find what the physical size of table in MS开发者_开发问答 Sql 2005? Is it possible using sql query or not?

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


Try the stored procedure:

exec sp_spaceused TableName

For all tables you could use:

exec sp_Msforeachtable 'exec sp_spaceused ''?'''


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.


You can use the sp_spaceused system procedure:

EXECUTE sp_spaceused 'YourTable'


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

0

精彩评论

暂无评论...
验证码 换一张
取 消