Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 2.23 KB

sp-replsetoriginator-transact-sql.md

File metadata and controls

65 lines (45 loc) · 2.23 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_replsetoriginator (Transact-SQL)
sp_replsetoriginator used to invoke loopback detection and handling in bidirectional transactional replication.
markingmyname
maghan
randolphwest
08/22/2024
sql
replication
reference
sp_replsetoriginator
sp_replsetoriginator_TSQL
sp_replsetoriginator
TSQL

sp_replsetoriginator (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Used to invoke loopback detection and handling in bidirectional transactional replication. This stored procedure is executed at the Publisher on the publication database.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_replsetoriginator
    [ @originator_srv = ] N'originator_srv'
    , [ @originator_db = ] N'originator_db'
    [ , [ @publication = ] N'publication' ]
[ ; ]

Arguments

[ @originator_srv = ] N'originator_srv'

The name of the server where the transaction is being applied. @originator_srv is sysname, with no default.

[ @originator_db = ] N'originator_db'

The name of the database where the transaction is being applied. @originator_db is sysname, with no default.

[ @publication = ] N'publication'

[!INCLUDE ssinternalonly-md]

Return code values

0 (success) or 1 (failure).

Remarks

sp_replsetoriginator is executed by the Distribution Agent to record the source of transactions applied by replication. This information is used to invoke loopback detection for bidirectional transactional subscriptions that have the loopback property set.

Permissions

Only members of the sysadmin fixed server role at the Publisher, members of the db_owner fixed database role on the publication database, or users in the publication access list (PAL) can execute sp_replsetoriginator.

Related content