Transactional replication - Update issue

salilsingh-9961 346 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
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,607 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,546 questions
{count} votes

Accepted answer
  1. Tom Phillips 17,716 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