How to Open Or read SQL Server log file .ldf)

Dear Sir,

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.
Through program (visula basic or any other way). Can you help me.

Best Regards.
M. Md. Rafeek
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I'm not aware of anything to do this...

why are you even asking ... ?
the log format would be subject to potential change for each microsoft upgrade/fix....

alternatively the only consistent way of seeing what's in the logs

is to do some point in time restores and then detect the changes "normally" in your data tables...

There is a tool called LogExplorer from lumigent that will allow this  There are also several other packages that are starting to show up on the market--netIQ also has one.  LogExplorer will allow you to conditionally commit or rollback transactions.  Other than that, there isn't too much that you can do with the ldf (log file) yourself.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ralf KlattEmployee in Civil ServiceCommented:

@Lowfatspread ... why do hook to a question that you admit not to be able to answer?

@arbert ... you're ABSOLUTELY right!!!

@md_yasheen ... There is no easy way out if you want to read the transaction logs for whatever reason. The transaction log architecture is proprietary to Microsoft and is not published. However, there is an undocumented DBCC LOG command that lets you see the records in transaction log. Here is an example:

DBCC LOG (Your_Database_Name, 2)

As arbert postetd -> theress a third party tool called Log Explorer by ---> Lumigent <---, that helps you read transaction logs and do stuff like recovering data, auditing database etc.

Best regards, Raisor
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

raisor , for the challenge and the learning opportunities this creates...
          and of course because the idea of wanting to read the log files is so OTT, that there
          must be better ways of achieving what MD_yasheen thinks he needs to do...  
Ralf KlattEmployee in Civil ServiceCommented:

Yeah, I see what you mean -> but to be honest, I do not always say what I see without taking time off for reflection before -> and I don't even want to talk about the files that I looked at in the early years ;-)) -> ...

... my believe is: everyone goes its own way -> if md_yasheen gets closer to reading out any log file while reading out a transaction log -> well, then we have one more professional that knows to explain how to read lol files!

@md_yasheen ... can you please explain why it is important for you to read LDF files?

Best regards, Raisor
yes i'd want to know if md succeeds and manages to understand a particular log file version as well, its bound to come in handy at some stage...

best regards low
Ya, log explorer is handy (if not pricy).  Actually, we had a Microsoft Engineer on site 3days last week and he highly recommended it (we had already used it in the past).  Just like any tool though, it can be dangerous too....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.