Friday 10 June 2016

Get the Database physical location

With the help of System view known as Sys.Master_Files in the MSDB database, we can see the Physical location of the any database.

I am using the below SQL Script
SELECT  @@Servername AS Server ,
        Type_desc ,
        Name ,
        LEFT(Physical_Name, 1) AS Drive ,
        Physical_Name [Database file path] ,
        RIGHT(physical_name, 3) AS [File extension] ,
        Size ,
        Growth
FROM    sys.master_files


Below is the Output.
  

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts