-- 查看表占用的磁盘空间
use 库名
select object_name (a . object_id ) AS TABLENAME, a . row_count, a.reserved_page_count *8 / 1024 space_in_M
,a .reserved_page_count* 8/1024.00 / 1024 space_in_G
from sys .dm_db_partition_stats a( nolock ) JOIN sys. all_objects b (NOLOCK) ON a . object_id= b.object_id
where a .index_id <= 1
AND b .type = 'U' AND b. is_ms_shipped=0
--and row_count>10000000
--order by row_count desc
order by a. reserved_page_count desc
sql server查看表占用的磁盘空间
最新推荐文章于 2024-05-29 14:20:04 发布