Pages

Search This Blog

Wednesday, January 6, 2010

[T-SQL] Find Location of Data File

SELECT SUBSTRING(physical_name, 1,CHARINDEX(N'master.mdf',LOWER(physical_name)) - 1) DataFileLocationFROM master.sys.master_filesWHERE database_id = 1 AND FILE_ID = 1

No comments: