1月17日
SQL Server Transaction Log Accessing
Last week, I've received a problem from my internal team to find out a way to logg all CRUD (Create, Read, Update and Delete) transactions happened in a SQL Server database using transaction log file. They have analysed and did some analysis on other options like SSIS, stored procedure replication in OLTP, etc. But they want to know in transaction log file.
I've taken this and was searching that is there any APIs to access transaction log. After a while, I found that SQL Server does not provide any API to access transaction log. Instead, we can use DBCC LOG commands to access transaction log.
Though, The DBCC LOG is an undocumented command, I can read transaction log, but the information are in either enumerated or Hex format. And there is not documentation found about the details displayed by DBCC LOG.
And one of the major drawback is that transaction log does not keeps to log SELECT queries.
I found number of third party utilities who used transaction log to fetch the information and display them in user understandable format.
Still I'm searching and analysing the same, but I cannot find a result.