J'ai besoin d'une requête T-SQL pour une liste de toutes les bases de données dans SQL Server 2008 montrant
.mdf
et .ldf
des dossiers.SELECT
db.name AS DBName,
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
select
d.name as 'database',
mdf.physical_name as 'mdf_file',
ldf.physical_name as 'log_file'
from sys.databases d
inner join sys.master_files mdf on
d.database_id = mdf.database_id and mdf.[type] = 0
inner join sys.master_files ldf on
d.database_id = ldf.database_id and ldf.[type] = 1