Pages

Tuesday 27 March 2012

SQL SERVER - Find Database File and Log Path

I need to find the place where I have all the .mdf and .ldf files are stored. The following is the simple SQL query to find out where .mdf and .ldf files are stored. This list helps to find database file and log path.

SELECT name, physical_name AS current_file_location
FROM sys.master_files

Following is the output for the files used by SQL Server instance.















For more details, please visit: http://msdn.microsoft.com/en-us/library/ms186782.aspx

No comments: