question

AliRashid avatar image
AliRashid asked

Replicating CDC Table

Hello All, I have a request to add change data capture(CDC) table to existing replication. The CDC table does not have a primary key so therefore it cannot be added into the replication. The question I have is whether I can alter cdc table to create primary key? Will adding PK can break CDC altogether? How can I replicate CDC tables to another instance without breaking anything. We do not have test environment, all this will be done straight in production. Thanks in advance.
sql-server-2008replicationdbachange-data-capture
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
KenJ avatar image
KenJ answered
You can create a copy of the CDC table that has a primary key then periodically query the rows out of the CDC table using cdc.fn_cdc_get_all_changes_ - [ http://msdn.microsoft.com/en-us/library/bb510627(v=sql.105).aspx][1] Replicate the copy table. [1]: http://msdn.microsoft.com/en-us/library/bb510627(v=sql.105).aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.