테이블별 사이즈 및 Row 수 체크하기

by kay posted Aug 26, 2013
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

테이블별 용량 및 Rows 체크하기



SELECT table_name = convert(varchar(30), min(o.name))
,Rows = rowCnt
, table_size = convert(int, ltrim(str(sum(cast(reserved as bigint)) * 8192 / 1024., 15, 0))), UNIT = 'KB' 
 
FROM sysindexes i 
  INNER JOIN 
  sysobjects o
  ON (o.id = i.id) 
WHERE i.indid IN (0, 1, 255)
AND  o.xtype = 'U' 
GROUP BY i.id,rowCnt
ORDER BY table_size DESC

Articles

1 2 3