SQL SERVER TRANSACTIONAL REPLICATION MISSES RECORDS SOMETIMES

DM 546 Reputation points
2021-10-29T18:42:46.727+00:00

We have setup of SQL SERVER transactional replication between multiple servers. It happens that replication monitor shows the status as green but in between out of say 500 entries per day; randomly say 5 to 6 entries do not reach subscriber servers and replication monitor says records pending as zero. Also; frequently; edits that data user does at publisher end servers do reach partially to subscriber; means say we have edited 3 fields of a record at publisher out of it only 1 field value reaches and 2 columns updated value to not reach the subscriber. May suggest. Thanks for help.

SQL Server | Other
0 comments No comments
{count} votes

Accepted answer
  1. Tom Phillips 17,771 Reputation points
    2021-10-29T19:00:07.893+00:00

    What you are describing is not possible with transactional replication from a publisher to a subscriber(s).

    Transactional replication replays the COMMANDS run on the publisher on the subscribers, in the order they occur. It does not transfer the "data" changed and it is not possible to skip commands from replaying.

    When you run a command on the publisher like:

    UPDATE table SET col1=xxxx

    Transactional replication stores that COMMAND and runs the same command on the subscriber. If the command errors, it stops and will not continue with other commands until that problem is fixed or the command is manually deleted from the distributor commands table.

    Unless what you are really using is "merge" or "bidirectional" replication. In which case, you can have "conflicts" in changes, and those are automatically handled and logged. See: https://learn.microsoft.com/en-us/sql/relational-databases/replication/transactional/peer-to-peer-conflict-detection-in-peer-to-peer-replication?view=sql-server-ver15


1 additional answer

Sort by: Most helpful
  1. YufeiShao-msft 7,146 Reputation points
    2021-11-01T07:56:49.653+00:00

    Hi @DM ,

    if the schema mismatch at the publisher and subscriber, the subscriber does not get the column:
    https://www.mssqltips.com/sqlservertip/4262/tracking-sql-server-replication-subscriber-schema-changes-disrupting-data-flow/

    it is a good idea to check the underlying tables directly, they will provide information faster and are more up-to-data.

    here is way to troubleshoot:
    https://www.mssqltips.com/sqlservertip/2853/troubleshooting-sql-server-replication/

    -------------

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.