How to Open Or read SQL Server log file .ldf



    Hi all,

    How to Open Or read SQL Server log file .ldf


    When ever we create database from sql server, it's create two file. (1) .mdf (2) .ldf.
    I want to see what's available inside the .ldf file.





    Wednesday, March 26, 2008 10:45 AM


All replies

  • The .ldf is the log file for a database.  There are no native tools in sql server to read the log file, although there are some third party vendors that have software that can read log files.  You need to be VERY careful when doing anything with the log file as if it becomes corrupt you can possibly render your database corrupt also or destroy any possibility of have a viable log file to restore your database.



    Wednesday, March 26, 2008 1:11 PM
  • I am not too sure but may be the below two undocumented commands might yield the desired result.
    1. DBCC Log
    2. Fn_dblog function
    Refer these links for more info,,289483,sid87_gci1173464,00.html

    Some 3rd party tools like Log Explorer can do the job for you.

    - Deepak

    Wednesday, March 26, 2008 1:42 PM
  • Hi all;
    If you want view your files, you can download a sofware named xnview (search it, for example by google) and open *.ldf & another unusual formats.
    I hope a lot of good wishes for you.
    Ali From Iran...
    Saturday, July 25, 2009 8:56 AM
  • Late answer, but I hope it'll be helpful for other users who read this thread:

    In order to view the LDF file contents in a human readable format, you can use 3rd party log readers for now. My recommendations are: ApexSQL Log (I personally used it and it worked for me) or Quest (which I heard of but never used before).

    Thursday, October 31, 2013 9:49 AM
  • Hi Ashok

    Glad that you asked, for SQL Server transaction log file open and read you take the help of specific log analyzer tool, such tool is developed to open, view and read the all the activities in SQL Server database and they easily assist you view the SQL log file & also export the log file data. One such tool that you can use is,

    Hopefully you will be able to view and export your SQL log file with it.



    Friday, January 31, 2014 4:19 PM