如何使用T-SQL在SQL2008中找到mdf / ldf位置?从“属性”屏幕开始,生命太短,容易出错。
答案 0 :(得分:3)
SELECT DB_NAME(database_id) AS DatabaseName
,Name AS Logical_Name
,Physical_Name
,(size*8)/1024 SizeMB
FROM sys.master_files
WHERE DB_NAME(database_id) = 'Your_database_Name'
GO
或
Use Database_Name
GO
SELECT name
,type_desc
,physical_name
,(size*8)/1024 SizeMB
FROM sys.database_files
GO
答案 1 :(得分:1)
试试这个:
select filename FROM sysfiles