查询表空间及行数

查询表空间及行数

SELECT OBJECT_NAME(id) AS TableName ,
rowcnt AS ROWS,
reserved * 8.0 AS Reserved_KB,
dpages * 8.0 AS USED ,
(used – dpages)* 8.0 AS index_size_KB,
( reserved – used ) * 8.0 AS Unused
FROM sysindexes
WHERE indid = 1
–AND OBJECT_NAME(id) = ‘users’
ORDER BY reserved DESC

或者:EXEC sp_spaceused ‘bdorder’