查詢sql語句
SELECT
obj.name "表名",
pt.rows "行數(shù)",
SUM(acu.used_pages)*8/1024 "大械挡濉(MB)"
FROM sys.objects obj
JOIN sys.indexes idx on obj.object_id = idx.object_id
JOIN sys.partitions pt on obj.object_id = pt.object_id
JOIN sys.allocation_units acu on acu.container_id = pt.partition_id
WHERE obj.type = 'U' AND idx.index_id IN (0, 1)
GROUP BY obj.name, pt.rows
ORDER BY 3 DESC