info@techdevops.com
TechDevOps.com
Explore Tools
Experts in Microsoft SQL Server Operations, Performance, Migrations, Replication & Cloud



List information about all SQL Server Databases & Files
by BF (Senior MSSQL Operations - Enterprise, Cloud, Strategy)
2015-08-06







Solution:


SELECT
t2.database_id ,
t2.name AS DBName,
t2.collation_name,
t2.compatibility_level,
t2.recovery_model_desc,
t1.type_desc AS FileType,
t1.file_id,
t1.Physical_Name AS Location
FROM
sys.master_files t1
INNER JOIN
sys.databases t2 ON t1.database_id = t2.database_id