문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top