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:
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_'. 2812Cause
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
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.