[MSSQL] 데이터베이스 용량 조회 쿼리
SELECT b.groupname AS 'File Group' , Name , [Filename] , CONVERT (Decimal(15,2),ROUND(a.Size/128.000,2)) [할당된 용량 (MB)] , CONVERT (Decimal(15,2) , ROUND(FILEPROPERTY(a.Name,'SpaceUsed')/128.000,2)) AS [사용중인 용량 (MB)] , CONVERT (Decimal(15,2) , ROUND((a.Size-FILEPROPERTY(a.Name,'SpaceUsed'))/128.000,2)) AS [사용가능한 용량 (MB)] FROM dbo.sysfiles a (NOLOCK) JOIN sysfilegroups b (NOLOCK) ON a.groupid = b.g..
2023. 4. 7.