SELECT *
FROM (
SELECT SUM(unallocated_extent_page_count) AS [free pages]
, (SUM(unallocated_extent_page_count)*1.0/128) AS [free space in MB]
FROM tempdb.sys.dm_db_file_space_usage
) AS A cross JOIN (
SELECT SUM(size)*1.0/128 AS [size in MB]
FROM tempdb.sys.database_files
) AS B
SELECT SUM(internal_object_reserved_page_count) AS [internal object pages used]
, (SUM(internal_object_reserved_page_count)*1.0/128) AS [internal object space in MB]
FROM sys.dm_db_file_space_usage;
SELECT SUM(user_object_reserved_page_count) AS [user object pages used]
, (SUM(user_object_reserved_page_count)*1.0/128) AS [user object space in MB]
FROM sys.dm_db_file_space_usage;
'MS-SQL' 카테고리의 다른 글
SQL SERVER 문자열 랜덤 뽑기 (0) | 2024.01.23 |
---|---|
[MS-SQL] 테이블 설명 넣기 (0) | 2023.04.19 |
Float() 조심! (0) | 2023.01.26 |
[MS-SQL] CPU 사용량 높은 쿼리 조회 (0) | 2022.11.10 |
VARCHAR, NVARCHAR (0) | 2022.08.19 |