info@techdevops.com | 437-991-3573 | Data Engineering Services
TechDevOps.com
Resources Tools Services
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance



List information about all SQL Server Databases & Files
by BF (Principal Consultant; Architecture; Engineering)
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