| title | Bidirectional Transactional Replication | |||
|---|---|---|---|---|
| description | Bidirectional transactional replication lets two servers exchange changes. Each server publishes data and subscribes to a publication from the other server. | |||
| author | MashaMSFT | |||
| ms.author | mathoma | |||
| ms.date | 09/25/2024 | |||
| ms.service | sql | |||
| ms.subservice | replication | |||
| ms.topic | concept-article | |||
| ms.custom |
|
|||
| helpviewer_keywords |
|
|||
| monikerRange | =azuresqldb-mi-current||>=sql-server-2016 |
[!INCLUDEsql-asdbmi]
Bidirectional transactional replication is a specific transactional replication topology that allows two servers to exchange changes with each other: each server publishes data and then subscribes to a publication with the same data from the other server. The @loopback_detection parameter of sp_addsubscription (Transact-SQL) is set to TRUE to ensure that changes are only sent to the Subscriber and do not result in the change being sent back to the Publisher.
In [!INCLUDEssVersion2005] and later versions, this topology is also supported by peer-to-peer transactional replication, but bidirectional replication can provide improved performance.
If you want to add a subscription to a bi-directional publication by using the the fully-qualified domain name (FQDN), verify that the server name (@@SERVERNAME) of the subscriber returns the FQDN. If the subscriber server name does not return the FQDN, changes that originate from that subscriber may cause primary key violations.