Technical Article

List file name, size of all databases

,

SELECT

    db.name AS DBName,

    type_desc AS FileType,

    Physical_Name AS Location,mf.size/128 as Size_in_MB

FROM

    sys.master_files mf

INNER JOIN

    sys.databases db ON db.database_id = mf.database_id

    ORDER BY  Size_in_MB DESC,DBName

SELECT
    db.name AS DBName,
    type_desc AS FileType,
    Physical_Name AS Location,mf.size/128 as Size_in_MB
FROM
    sys.master_files mf
INNER JOIN 
    sys.databases db ON db.database_id = mf.database_id

ORDER BY  Size_in_MB DESC,DBName

Rate

2.75 (4)

You rated this post out of 5. Change rating

Share

Share

Rate

2.75 (4)

You rated this post out of 5. Change rating