ldf file path in server ?

  • 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?

  • 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/

  • select db_name(database_id),type_desc,physical_name from sys.master_files

  • 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