How to view data of MDF/LDF file ?


  • Hello friends,

    I have MDF/LDF files but I haven't installed SQL server.

    How to view data of MDF/LDF file ?

    Thanks in advance,

    Rajan Dahal

    School of Computer Studies (SCS)

    Kathmandu, NEPAL

    Wednesday, June 06, 2012 2:48 AM


All replies

  • Hi,

    these are the files used by SQL server for storing data and log files. You cant directly view the contents of these files

    MDF contains all tables, objects and data, so these information you can retrieve thru queries 

    LDF is file which stored the log information, so you can read the log file using the query

     SELECT *
      FROM ::fn_dblog(null,null)
    Yes, for all these you need to install SQL Server 


    Wednesday, June 06, 2012 3:31 AM
  • Hi,

    to read this you need to first install the sql server.

    If .mdf file is  smaller than 4 GB you can use SQL Server Express for free.

    Wednesday, June 06, 2012 4:52 AM
  • As sushil pointed  you need to install SQL Server first, more over , try to install a version highest as possible , otherwise you won't be able to attach those files  in order to "view" them :-)

    Best Regards, Uri Dimant SQL Server MVP

    Wednesday, June 06, 2012 5:21 AM