SQL Server Performance

Accessing replicated data on subscriber for failed replication

Discussion in 'SQL Server 2005 Replication' started by Mbarve, Feb 4, 2009.

  1. Mbarve New Member

    Hi,
    Our application involves replication process to replicate some tables to other database. We are using Transactional Replication method for this by applying snapshot. my concern is I want to access exact record that is being replicated to subscriber in case of failure. i.e. when replication fails, i want to return back the current record to the publisher from the subscribr or distributor. I have studied some of the replication tables present in system databases like msreplalerts, msrepl_errors, msrepl_transactions etc. but could not find useful info for how to access exact record from current job.
    Can anyone help in this regard. How i can get actual data from subscriber/distributor when replication fails. Because I want to change status for that record accordingly in the publisher database. Is ther any other way to achieve this?
    Also how using RMO from code can help me for this? can anyone give any sample code??
    please suggest ASAP.
  2. preethi Member

    Hi,
    Replication can fail due to many reasons, including network issues. Do you have a specific scenario to say where the failure happens. Writing code to suit all possible cases is not possible within a thread.
    I have written code for one specific case: Te data is copied into distribution database, but failed in the subscriber. This is happening through stored procedures, generally starting with sp_ msins, sp_msupd or sp_msdel. You can identify them by reading the subscription properties.
    You can modify the procedures to suit your requirements.
    This is not a complete answer, but this could a starting point.
    Best of luck

Share This Page