Blog Post

SQL Server Support Blog
1 MIN READ

Cannot Replicate Stored Procedure Execution when CDC is enabled

Taiyeb_Zakir's avatar
Taiyeb_Zakir
Icon for Microsoft rankMicrosoft
Mar 17, 2021

With Transactional Replication you can replicate execution of the Stored Procedure like this:

 

 

This has several advantages as discussed in this article:

https://docs.microsoft.com/en-us/sql/relational-databases/replication/transactional/publishing-stored-procedure-execution-in-transactional-replication?view=sql-server-ver15

 

When you enable CDC at the Database level, replication of the stored procedure execution will NOT work. This is By Design. CDC does not support tracking at stored procedure execution level, which means individual rows logged by stored proc execution need to be flagged with REPLICATE bit, which makes it impossible for transactional replication to replicate stored proc execution.  As a result, ‘stored proc execution’ will work only when transactional replication is enabled and CDC is disabled.

Updated Mar 17, 2021
Version 1.0
No CommentsBe the first to comment