Total Pageviews

Search This Blog

Friday, September 30, 2011

SQL Tip - List all databases file path

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


It will return you the database names alongwith physical paths

To read more about sys.master_files and the additional columns, read here

1 comment:

wojzeh said...

It works! Thank you!

Just a quick question. Why it shows some databases that do not exist anymore?