April 28, 2010 at 5:10 am
When ever we create database from sql server, it's create two file. I want to see what's available inside the .ldf file. Through program (with visula basic .net ). PLease guid me ...
April 28, 2010 at 6:42 am
The ldf is the transaction log, a record of changes made to the database.
Why do you want to read it? It's not intended to be human-readable, it's for the database, to guarantee consistency and durability.
If you really want, you can use this undocumented feature from Management studio
SELECT * FROM fn_dblog(null, null)
Is this just curiosity? Or is there something specific that you're looking for?
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
April 29, 2010 at 3:57 am
GilaMonster (4/28/2010)
The ldf is the transaction log, a record of changes made to the database.Why do you want to read it? It's not intended to be human-readable, it's for the database, to guarantee consistency and durability.
If you really want, you can use this undocumented feature from Management studio
SELECT * FROM fn_dblog(null, null)
Is this just curiosity? Or is there something specific that you're looking for?
No, it's not curiosity, i looking for store procedure about this problem. do you know a procedure about it??
tanks
April 29, 2010 at 4:03 am
gilproject (4/29/2010)
No, it's not curiosity, i looking for store procedure about this problem. do you know a procedure about it??
What problem? There's no documented way to read the transaction log, the query I gave you is an undocumented way, you can use that.
That said, what are you trying to do? Why do you want to read the transaction log? What's the purpose behind this request?
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
April 29, 2010 at 5:20 am
i want to see footprint of change on the database.
April 29, 2010 at 5:47 am
Since you're using SQL 2008, have you looked at Change data capture or Change tracking? Other than those, triggers on the tables you're interested in or SQL trace.
The transaction log is not intended as an audit log.
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
May 1, 2010 at 1:21 am
i'm engineer student and "Read Log file" is my DB Class exercise. i'm not bad guys and i dont want it for bad purpose. is it clearly???ok??
it,s only for learning purpose.
tanks for help;-)
May 1, 2010 at 6:16 am
if it's a class exercise, I'm sure if you read the instructions for the exercise, or maybe read the chapter in your study materials for the course, it will cover this in more detail than you'd get from a forum. All the classes I've ever take gave me the tools to do the exercise if i put the effort in to do them myself.
Can you show us what you've tried so far?
Lowell
May 1, 2010 at 6:35 am
Indeed. And reading SQL's transaction log is a really odd thing to ask in a class exercise. If the exercise just asks you to track data changes, it's pretty unlikely that reading the transaction log is the answer that the teacher wants.
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 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply