Location of Data File Using T-SQL


Some times we need know the location of Data file of databases of sqlserver.Below script display the all the .mdf and .ldf files of sqlserver.

select Name as DataBasename,Physical_name as Location From master.sys.master_files

Advertisements
This entry was posted in Articles and tagged , , . Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s