Skip to content

Commit 22a0bb8

Browse files
authored
Merge pull request #8398 from asavioliMSFT/patch-2
AB#4691: Update update-statements-replicated-as-delete-insert.md
2 parents 376dd13 + ddb29e4 commit 22a0bb8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

support/sql/database-engine/replication/update-statements-replicated-as-delete-insert.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Update is replicated as DELETE/INSERT pairs
2+
title: Update Is Replicated as DELETE or INSERT Pairs
33
description: This article describes that Update statements may be replicated as DELETE/INSERT pairs.
4-
ms.date: 11/15/2024
4+
ms.date: 03/20/2025
55
ms.custom: sap:Replication, Change Tracking, Change Data Capture, Synapse Link
6-
ms.reviewer: RAJUGIRD
6+
ms.reviewer: RAJUGIRD, ansavio
77
ms.topic: reference-architecture
88
---
99
# UPDATE statements may be replicated as DELETE/INSERT pairs
@@ -39,7 +39,7 @@ UPDATE TABLE1 set col1 = 3 where col3 = 'Dallas'
3939

4040
The `UPDATE` statement is implemented by SQL Server as a pair of `DELETE`/`INSERT` statements since you're updating `col1`, which has a unique index defined. Thus, the log reader places a pair of `DELETE`/`INSERT` calls in the distribution database. This can impact any business logic that is present in the triggers or custom stored procedures at the Subscriber. You should incorporate the additional business logic in `DELETE` and `INSERT` triggers or stored procedures to handle this situation.
4141

42-
If you prefer to use single logic and you want all your `UPDATE` commands replicated as `DELETE`/`INSERT` pairs, you can enable [Trace Flag 8207](/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql#tf8207).
42+
If you prefer to replicate single-row updates as `UPDATE` statements instead of `DELETE` or `INSERT` pairs, you can enable [Trace Flag 8207](/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql#tf8207).
4343

4444
Additionally, if you use a horizontal filter in your publication and if the updated row doesn't meet a filter condition, only a `DELETE` procedure call is sent to the subscribers. If the updated row previously didn't meet the filter condition but meets the condition after the update, only the `INSERT` procedure call is sent through the replication process.
4545

0 commit comments

Comments
 (0)