May 18, 2010 at 5:18 am
Hi,
I am using SQL Server 2008. While updating, deleting or inserting I am using Begin Trans.....Commit Trans statement. After using this statement the information is written in transaction log file. How can I view that transaction log file (I mean I don't know how to open the transaction log file). I want to view the content of transaction log file so that I can come to know which data is update, deleted or inserted.
Regards,
Nikhil
May 18, 2010 at 6:38 am
You can't view the transaction log file, at all, unless you purchase a third party product specifically made for reading the log.
Why do you need to do this? You should be able to see what was changed within the tables.
If you want to know what was changed as you modify data, you can use the OUTPUT clause. Within SQL Server there is also a mechanism called Change Data Capture that will show you what was modified over time, more for auditing. But without knowing what it is that you're looking for, I'm not sure that either of these is what you need or if you need something else.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
May 18, 2010 at 6:38 am
There's no documented way to read the transaction log.
If you're feeling like a challenge, you can use fn_dblog
SELECT * FROM fn_dblog(null, null)
however it's not the easiest to understand, the transaction log is not intended to be human-readable
Is this just for curiosity or is there something you're trying to achieve here?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply