Read insert/update/delete queries from SQL transaction log file

Copper Contributor

Read insert/update/delete queries from SQL transaction log file. I am using to read fn_dblog function , using this function I could see only transaction name only not read transaction queries. I think there some 3rd party tools they have read that in the same way I want to read that transaction queries. In log shipping restore job read that transaction log file and restore the data in to secondary database  tables. I want to know how to read that DML operation from Transaction log (.ldf) file.

3 Replies

@showman 


I could see only transaction name only not read transaction queries. 

SQL Server don't log the queries, only data changes; so you can't get it.

You have to implement a DML logging.

I want to read that changes from .ldf file ? How? with out CDC and Triggers?
The function fn_dblog exists, but the usage is not supported and so there is no supported way to get data from transaction log.