KB2931001 - FIX: Distribution Agent skips applying sp_MSins_, sp_MSupd_, sp_MSdel_ stored procedures on a Subscriber that is initialized with Backup in SQL Server 2012 or SQL Server 2014

Applies To
SQL Server 2012 Developer SQL Server 2012 Enterprise SQL Server 2012 Standard SQL Server 2014 Developer - duplicate (do not use) SQL Server 2014 Enterprise - duplicate (do not use) SQL Server 2014 Standard - duplicate (do not use)

Symptoms

When you set up a Transactional replication and Initialize a transactional subscription from a backup in Microsoft SQL Server 2012 or SQL Server 2014. During the initial synchronization, the Distribution Agent fails, and you receive the following errors:

Note

Connecting to Subscriber
Initializing
No replicated transactions are available.
42000 Could not find stored procedure 'sp_MSins_'. 2812
42000 Could not find stored procedure 'sp_MSins_'. 2812

Cause

This issue is caused by a difference in timing between the log reader agent and Distribution Agent initial execution. If there are lot of transactional changes occurring at the publisher there is a delay in log reader agent generating and adding the custom stored procedure scripts into MSRepl_commands in the distribution database. If the Distribution Agent starts and has already made a roundtrip to the distribution database before these commands are added, it will move the transaction time stamp ahead and will report ‘No replicated transactions are available’. Later synchronization attempts by the Distribution Agent cannot detect the custom stored procedure creation commands and will fail with the errors that are mentioned in the "Symptoms" section.

Resolution

The issue was first fixed in the following cumulative update of SQL Server.

Cumulative Update 1 for SQL Server 2014 /en-us/help/2931693

Cumulative Update 9 for SQL Server 2012 SP1 /en-us/help/2931078

About cumulative updates for SQL Server

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

      

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.