Thursday, April 7, 2016

SQL SERVER – Find Current Location of Data and Log File of All the Database



  • below query returns the current location of data and log file of all dbs in current server

 

                  SELECT name, physical_name AS current_file_locationFROM sys.master_files



  • Location for the  DB on local drive

              \Program Files\Microsoft SQL Server\MSSQL.90\MSSQL\Data\


                C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL

No comments:

Post a Comment