Record the error resolution in the process of subscribing and publishing in Sqlserver database
Record an error report in the sqlserver subscription and publishing process and resolve the error report: 20598 error report
20598 the error report is mainly due to the inconsistency of the database data at both ends, and the database produces an error prompt when applying the stored procedure.
The row was not found at the subscriber when the replicated command was applied
Error messa
Attempted command:
If @ @ trancount > 0 rollback tran
Transaction sequence number:
-- 0x0000FDAB0003A908008F00000000 command ID: 7
Error message:
The row was not found at the subscriber when the replicated command was applied. (source: MSSQLServer, error number: 20598)
Get help: http://help/20598
The row was not found at the subscriber when the replicated command was applied. (source: MSSQLServer, error number: 20598)
Get help: http://help/20598
Execute the following statement on the publication database to view the id of the error transaction
Use distributiongoexec sp_helpsubscriptionerrors' SSDTCEMANTEST','ssdt','skl_11_8','ANCHNET','ssdt';use distributiongoselect * fromdbo.MSarticles mwhere exists (select mc.article_id from MSrepl_commands mc where mc.xact_seqno=0x00011F4000009D42006B00000000 AND mc.article_id = m.article_id) EXEC Sp_browsereplcmds@xact_seqno_start='0x00011F4000009D42006B00000000',@xact_seqno_end='0x00011F4000009D42006B00000000'
Judge according to the actual situation, whether to recover the data or skip the stuck transaction ID
-skip errors on the subscription machine-on the distribution machine-- Syntax exec sp_helpsubscriptionerrors [@ publisher =] 'publisher' [@ publisher_db =] 'publisher_db', [@ publication =]' publication', [@ subscriber =] 'subscriber', [@ subscriber_db=]' subscriber_db'--get publisher subscriberselect*from MSsubscriber_info--get publisher_db publication subscriber_db=publisher_dbselect*from MSpublications--exampleexec sp_helpsubscriptionerrors' SQLw2k8','dbtranpub','dbtranpub_pub','SQLw2k8Subscriber' 'dbtransub'-- gets the xact_seqno value-- on the subscription machine-- sp_setsubscriptionxactseqno [@ publisher=] 'publisher', [@ publisher_db=]' publisher_db', [@ publication=] 'publication', [@ xact_seqno=] xact_seqno--example (ignore) exec sp_helpsubscriptionerrors' SQLw2k8','dbtranpub' 'dbtranpub_pub',xact_seqno