본문 바로가기
개발팁

MSSQL 테이블별 용량 확인쿼리

by devscb 2022. 4. 26.
반응형

MSSQL 테이블별 용량 확인쿼리

 


 

 


SELECT 
	CONVERT (VARCHAR(30), MIN(o.name)) AS table_name , 
	LTRIM(STR(SUM(reserved) * 8192.0 / 1024.0, 15, 0) + ' KB') AS table_size,
	SUM(reserved) AS sum_reserved
FROM 
	sysindexes i, sysobjects o 
WHERE 
	o.id = i.id 
	and i.indid IN (0, 1, 255) AND o.xtype = 'U' 
GROUP BY 
	i.id 
ORDER BY 
	sum_reserved desc 
 


#테이블,#용량,#MSSQL

https://devscb.com/post/90

 

Query to check capacity for each MSSQL table

Query to check capacity for each MSSQL table 12345678910111213SELECT CONVERT (VARCHAR(30), MIN(o.name)) AS table_name , LTRIM(STR(SUM(reserved) * 8192.0 / 1024.0, 15, 0) + ' KB') AS table_

devscb.com

 

728x90
반응형

댓글