Skip Faulty Commands and Error Handling

Use sysadmin skip_bad_repserver_cmd to instruct Replication Server to skip a failed replication definition request the next time Replication Agent starts.

Warning!  Use sysadmin skip_bad_repserver_cmd carefully. If you execute the command, and then restart the Replication Agent without executing the corrected replication definition command in the primary Replication Server, primary data may replicate using the wrong replication definition version.

In this example, sysadmin skip_bad_repserver_cmd instructs Replication Server and Replication Agent to skip the last failed replication definition command in the pubs2 database of the SYDNEY_DS data server:

sysadmin skip_bad_repserver_cmd, SYDNEY_DS, pubs2

If the replication definition request you execute at the primary database through rs_send_repserver_cmd fails at the primary Replication Server, Replication Agent shuts down. If you restart Replication Agent, the failed command executes again unless Replication Server skips the command. The replication definition request can fail if:

If you can resolve the problem that caused Replication Agent to shut down, for example, by waiting for the subscription to complete or correcting the replication definition, you can then restart Replication Agent and Replication Agent reissues the replication definition request.

If the failed replication definition request is caused by an error that cannot be easily fixed, such as a syntax error:

  1. Execute the correct replication definition command directly at the primary Replication Server.

  2. Execute sysadmin skip_bad_repserver_cmd at the primary Replication Server to ensure that Replication Agent and Replication Server skip the most recent failed request that Replication Agent sent.

  3. Restart the Replication Agent.