web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

SQL Tip - List all databases file path

Dilip Profile Picture Dilip 1,164
Today, @ work, I needed to find out the physical file location for .mdf and .ldf files of all our databases on SQL

Just fire this query in SSMS Query Editor

SELECT name, physical_name FROM sys.master_files

Output:

It will return you the database names alongwith physical paths

To read more about sys.master_files and the additional columns, read here http://msdn.microsoft.com/en-us/library/ms186782.aspx


This was originally posted here.

Comments

*This post is locked for comments