Transactional replication - Update issue

salilsingh-9961 351 Reputation points
2021-04-12T10:29:34.71+00:00

Hi Team,

I have a requirement where i need to remove and apply transactional replication on a daily basis.
After removing and applying transaction, as the snapshot gets created each time, control tries to insert exiting records in publisher table (which are also exiting in subscriber table) to the subscriber table and thus error comes.
How can i ensure that existing records in publisher/subscriber table are updated only to the subscriber table?

Thanks,
Salil

Azure SQL Database
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
{count} votes

Answer accepted by question author
  1. Tom Phillips 17,781 Reputation points
    2021-04-12T16:13:48.763+00:00

    I am unclear what exactly you did. What exactly did you do to create your subscriber the first time? Why are you removing and applying transactional replication every day?

    Transactional replication requires an initial "snapshot" or restore. After that process is complete, transactional replication applies the commands run on the publisher to the subscriber(s).

    The only reason you would get duplicate errors, is if you applied the changes to the subscriber a different way than transactional replication.


0 additional answers

Sort by: Most helpful

Your answer

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