How to query the content of LDF file in SQL Server

%3CLINGO-SUB%20id%3D%22lingo-sub-2281558%22%20slang%3D%22en-US%22%3EHow%20to%20query%20the%20content%20of%20LDF%20file%20in%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2281558%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20to%20query%20the%20content%20of%20LDF%20file%20in%20SQL%20Server%26nbsp%3Bthough%20sql%20sentence%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2282535%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20the%20content%20of%20LDF%20file%20in%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2282535%22%20slang%3D%22en-US%22%3E%3CP%3Ethanks%2Cguys.But%20is%20the%20result%20of%20this%20SQL%20query%20the%20whole%20content%20of%20the%20log%3F%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F792867%22%20target%3D%22_blank%22%3E%40olafhelper%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2282218%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20the%20content%20of%20LDF%20file%20in%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2282218%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20no%20supported%20way%20to%20read%20the%20content%20of%20the%20log%20file%20(LDF)%2C%20that's%20omething%20completley%20internal.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20there%20is%20the%20unsupported%20function%20fn_dbog%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22kwd%22%3ESELECT%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd2%22%3ECOUNT%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E*%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EFROM%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20fn_dblog%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd3%22%3Enull%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd3%22%3Enull%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

How to query the content of LDF file in SQL Server though sql sentence

2 Replies

Hello,

 

There is no supported way to read the content of the log file (LDF), that's omething completley internal.

 

But there is the unsupported function fn_dbog:

 

SELECT COUNT(*) FROM fn_dblog(null,null)

 

thanks,guys.But is the result of this SQL query the whole content of the log?@olafhelper