Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From the technet article for Microsoft's Log Parser 2.2 it states that

"Can't find an input format you need? The new COM input format makes it possible to create your own custom Input Format and plug it into the Log Parser engine."

Is it possible to create such a COM input format for Microsoft SQL LDF files (2005/2008), and if so any examples of how it can be done?

We are wanting the ability to investigate the LDF files to better support our development staff without breaking the bank.

share|improve this question

migrated from Jan 5 '12 at 18:37

This question came from our site for professional and enthusiast programmers.

Reading ldf files is not the way to do this. If you are looking for statistical analysis on transactions, you should consider any degree of auditing. SQL Server is great with that. Reading ldf files is a nasty hack, and not what log files are intended for. – Thomas Stringer Jan 5 '12 at 15:24
SQL Server transaction logs are nothing like the logs that log parser is built to deal with. – Damien_The_Unbeliever Jan 5 '12 at 15:55
You probably want to look the the SQL ERROLOG file, which is something the Log Parser can parse. – Remus Rusanu Jan 5 '12 at 19:27

Log != transaction log

That said, if you were hell bent on torturing yourself or a development team with an arduous time consuming task that would yield minimal value, this would be an ideal project. The cheaper option (if viewing transaction log records is really what you need) would be a 3rd party tool like ApexSQL Log.

Depending on what you're trying to achieve with this, the undocumented fn_dblog command might be of interest to you. Also see Tracking Transaction Log Activity in Denali for a neater way of handling this with extended events in the 2012.

If you expand your question with a better description of why you want to look at log records, we can suggest alternative (less hacky) approaches.

share|improve this answer
Not to mention that if you were to write something to read the transaction log, you would need to change it every time Microsoft changes the format of the log, which could be as frequently as every service pack but is realistically every major release. – mrdenny Jan 6 '12 at 7:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.