Question

Imagine the following scenario. I have 2 T-SQL queries over 2 tables with some inner joins. I need to run these queries in 24-hour period and synchronize the query results with other two tables (only changed rows).

My question is: What technology is more suitable Change Data Capture or Replication?

Thank you for all your suggestions.

Was it helpful?

Solution

Let's say that somewhere in between your points of synchronization someone deleted the row

(ID, Name) = (15, 'John') 

After that he created the row

(ID, Name) = (15, 'Smith')

Do you need:

  1. Information that row with name 'John' has been deleted and now there is a new row with the name 'Smith'?
  2. Information that 'John' is now changed to 'Smith'?

If you need former, use CDC. If you need latter use replication. Or better, use Change Tracking (basically uses snapshot).

To sum it up, use CDC if you really need everything that has been changing over time. If you need only 'deltas', use change tracking.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top