SQL Server 2008のすべてのデータベースのリストを表示するT-SQLクエリが必要です
.mdf
および.ldf
ファイルの場所。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