'Could note execute Sp_replcmds' blocking the entries.

DM 501 Reputation points
2022-01-23T10:50:38.06+00:00

One morning; got message from one of the replicated locations (target database) that latest entries aren't seen (from source database); found that message was prompted as 'could not execute sp_replcmds'. After checking; fired the command as 'sp_replrestart' to start replication; after it replication started and latest entries got synced; however the entries from start of issue of 'could not execute sp_replcmds' until firing of sp_replrestart did not got replicated to target database.

Can this situation be avoided. Also, is there a way whereby; the entries from start of this message until replication restart do not get skipped and get synced to target database. Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,761 questions
{count} votes

Accepted answer
  1. Tom Phillips 17,716 Reputation points
    2022-01-24T14:19:35.5+00:00

    You should not ever run sp_replrestart. That is an internal stored proc which is used in by the system.

    sp_replrestart has reset the current pointer to say everything was delivered. The only way to fix this now, is to reinit the subscription.


1 additional answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,441 Reputation points
    2022-01-24T08:09:45.37+00:00

    Hi @DM ,

    Please see this similar thread: https://stackoverflow.com/questions/2723061/sql-server-2008-replication-failing-with-process-could-not-execute-sp-replcmds
    And this: https://www.dcac.com/sql/the-process-could-not-execute-sp_replcmds-on/

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments