Forum Discussion
shivkumarm
Jan 04, 2024Copper Contributor
Transactional Replication - Insert after Delete not working
We wanted to have a DR setup for our SQL Server databases. So for testing purpose we went ahead with Transactional Replication. Setup Server 1 (SQL Server 2019): Acting as Distributor and Publish...
shivkumarm
Jan 05, 2024Copper Contributor
Answer as per my investigation:
Normally this error occurs when an UPDATE or DELETE statement is executed by the publisher for a primary key value and the record (against which UPDATE/DELETE executed) does not exist in the subscriber database.
There are multiple reasons that could cause this:
- It could be someone or a process/apps deleted and inserted the data in subscriber db (while cmds are being applied). Review your subscriber security settings and check what process/apps are accessing the subscriber db.
- Multiple publications connected to subscriber db. pub1 (deleted the data first) then pub2 tried to UPDATE/DELETE the data which could cause an error 20598.
- Triggers on subscriber tables that could delete/insert/update the data.