Saturday, February 19, 2011

How does the SQL Server engine guarantees that Change Data Capture has extracted the necessary transactions from the transaction log file before log truncation occurs.

As you know Change Data Capture harvests transactions from the log file. I was wondering what happens when the log file gets truncated during transaction log backups or when an automatic checkpoint takes place on a database in simple recovery mode causing log truncation. What if the CDC job has not harvested those records in the portion of the log to be truncated. I had the feeling that the SQL Engine ensured that this would not happen but I wanted to understand the internals of this process. turns out, with all the information available about CDC it was hard to find a straight answer on this. But I did.