Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 266 Bytes

list-all-db-file-locations.md

File metadata and controls

14 lines (12 loc) · 266 Bytes

List all Database filenames and locations

SELECT
    db.name AS DBName,
    mf.name AS FileName,
    type_desc AS FileType,
    Physical_Name AS Location
FROM
    sys.master_files mf
INNER JOIN 
    sys.databases db ON db.database_id = mf.database_id