Home > SQL > Find Current Location of Data and Log File of All the Databas

Find Current Location of Data and Log File of All the Databas

We restored the database in the client development server for out client development and testing purpose.This time we need to take back and restore it in the client production machine. while am doing this we are unable to restore it. Later we found in client development machine client move the ‘.mdf and .ldf’ to different folder.

SELECT name, physical_name AS current_file_location
FROM sys.master_files

The above SQL script helped us to sort out the issue. We can also use this same script to clean up the junk database folder.

 

Advertisements
Categories: SQL
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: