Database File Locations

Here is a SQL Script to get database file locations.
This helps to locate the actual location of the database files on the physical drives.

This comes in handy when you are planning to do any database migrations to another server and to get an understanding of the database file locations.

USE master;
SELECT 
  name 'Logical Name', 
  physical_name 'File Location'
FROM sys.master_files;

Leave a Reply

Your email address will not be published. Required fields are marked *