SQL Server 表占用空间统计
EXEC sp_spaceused @updateusage = N'TRUE'
----
SELECT object_name(object_id) as ObjName,
index_id as IndexID,
sum(in_row_data_page_count) as InRowDataPages,
sum(lob_used_page_count) as LargeObjectPages,
sum(row_overflow_used_page_count) as RowOverflowPages,
sum(row_count) as Rows
FROM sys.dm_db_partition_stats
GROUP BY object_id,index_id
GO