Created
July 9, 2024 01:10
-
-
Save RobbiNespu/cc88831a07a23f272610437813fb2f2d to your computer and use it in GitHub Desktop.
MSQL : Find location of DATA and LOG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
d.name AS DatabaseName, | |
mf.type_desc AS FileType, | |
mf.physical_name AS FilePath | |
FROM | |
sys.master_files mf | |
JOIN | |
sys.databases d ON mf.database_id = d.database_id | |
WHERE | |
d.name NOT IN ('master', 'model', 'msdb', 'tempdb') -- Exclude internal databases | |
ORDER BY | |
DatabaseName, FileType; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment