February 24, 2009 at 3:40 am
Hi All
With the query mentioned below
"select name,filename from sys.sysdatabases "
I will know the database name and the path where the .mdf file of the db is present. Similarly if i need to know where .ldf file is present what is the query I need to use.
We can find this in object explorer window in files tab, but I wanted it to know through a query?
February 24, 2009 at 3:49 am
One way of getting this information is using sp_helpdb procedure.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 24, 2009 at 3:56 am
select db_name(database_id),type_desc,physical_name from sys.master_files
February 24, 2009 at 4:22 am
Yes, you can add where clause in the above query:
select db_name(database_id),type_desc,physical_name from sys.master_files where type_desc = 'LOG'
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply