Location of mdf and ldf

  • One of my database is not available(offline). Now how can I know the location of mdf & ldf of the database

  • Execute this code

    select d.name,mf.name,mf.physical_name

    from sys.databases d

    inner join sys.master_files mf on mf.database_id=d.database_id

    Igor Micev,My blog: www.igormicev.com

  • its working

    thanks @ Mr.Igor Micev

  • or without the join

    select db_name(database_id), name, physical_name

    from sys.master_files

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply