--查詢資料庫實體檔案位置
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'資料庫名稱');
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'資料庫名稱');
--ALTER DATABASE DB_NAME SET OFFLINE; 設離線