Tuesday, September 29, 2015

How to troubleshoot error 20598 - The row was not found at the Subscriber when applying the replicated command

Hi,

This is the error message you will get if the data is modified directly in Subscriber.
There are few steps, if you follow will help you to know the table with some data (basically just the PK) that the command is trying to apply towards subscriber.

Connect to your distributor server:

use distribution
select * from MSrepl_errors order by time desc

This command will give you all the errors occurred in replication.



Extract the command from the value in xact_seqno column above using the following store procedure:


exec dbo.sp_browsereplcmds '0x001927CF000678CD001400000000','0x001927CF000678CD001400000000'


The command column will show the command replication engine is trying to execute with each sp defined with action name on the table and the key value.

Solution:
There are 2 ways you can fix this problem:
  1. Insert the missing data in Subscriber. You might have to do this step more than once. Once replication engine can find that missing row, it will apply the action. You would only need to fill in Primary key columns.
  2. Make a change in the Distribution Agent to skip this error and continue with the replication. Distribution agent accepts the skiperrors parameter which will be 20598 in this case.
HTH

No comments: