The issue of sp_MScheckIsPubOfSub stored procedure We have SQL Server 2008 R2 Merge replication set up.

We have 20+ push subscriptions.

Once in a while I get the following error message during the sync:

Error messages: The merge process could not set the status of the subscription correctly.
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200963)
Could not find stored procedure 'dbo.sp_MScheckIsPubOfSub'.
(Source: MSSQLServer, Error number: 2812)


I have found the code for the mentioned SP &amp; ran it against the subscriber database &amp; everything worked fine.

My question is: why is this stored procedure getting deleted every now and then by itself ? And how I can troubleshoot this issue?
Please check for orphaned rows for deleted subscriptions in sysmergesubscriptions and delete them.  For example, the subscriber that this is failing on may have duplicate entries in sysmergesubscriptions, one being orphaned from a previously deleted subscription.

This has been the cause of this error and solution for clients of mine in the past, ymmv.  I hope this helps.