Answers for "sql server query database space available"

SQL
0

sql server query database space available

SELECT DB_NAME() AS DbName, 
    name AS FileName, 
    type_desc,
    size/128.0 AS CurrentSizeMB,  
    size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB
FROM sys.database_files
WHERE type IN (0,1);
Posted by: Guest on August-03-2021

Code answers related to "sql server query database space available"

Code answers related to "SQL"

Browse Popular Code Answers by Language