SQL2000, SQL2005, SQL2008でテーブルサイズを調査するクエリー
テーブル名、行数、データサイズ(MB)


SELECT object_name(id)as 'Table Name' ,rowcnt as 'Number of Rows',
dpages as 'Number of Pages',(dpages * 8 )/1024 'サイズ(MB)'
FROM sysindexes
WHERE indid IN (1,0)
AND OBJECTPROPERTY(id, 'IsUserTable') = 1
ORDER BY 'サイズ(MB)' DESC

Comments are closed.

Post Navigation