Forum Discussion
showman
Nov 08, 2023Copper Contributor
Read insert/update/delete queries from SQL transaction log file
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.
- olafhelperBronze Contributor
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.
- showmanCopper ContributorI want to read that changes from .ldf file ? How? with out CDC and Triggers?
- olafhelperBronze ContributorThe function fn_dblog exists, but the usage is not supported and so there is no supported way to get data from transaction log.