Skip to content

Latest commit

 

History

History
78 lines (53 loc) · 2.83 KB

sp-script-synctran-commands-transact-sql.md

File metadata and controls

78 lines (53 loc) · 2.83 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_script_synctran_commands (Transact-SQL)
Generates a script that contains the sp_addsynctrigger calls to be applied at Subscribers for updatable subscriptions.
markingmyname
maghan
randolphwest
08/21/2024
sql
replication
reference
sp_script_synctran_commands
sp_script_synctran_commands_TSQL
sp_script_synctran_commands
TSQL

sp_script_synctran_commands (Transact-SQL)

[!INCLUDE SQL Server]

Generates a script that contains the sp_addsynctrigger calls to be applied at Subscribers for updatable subscriptions. There's one sp_addsynctrigger call for each article in the publication. The generated script also contains the sp_addqueued_artinfo calls that create the MSsubsciption_articles table that is needed to process queued publications. 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_script_synctran_commands
    [ @publication = ] N'publication'
    [ , [ @article = ] N'article' ]
    [ , [ @trig_only = ] trig_only ]
    [ , [ @usesqlclr = ] usesqlclr ]
[ ; ]

Arguments

[ @publication = ] N'publication'

The name of the publication to be scripted. @publication is sysname, with no default.

[ @article = ] N'article'

The name of the article to be scripted. @article is sysname, with a default of all, which specifies all articles are scripted.

[ @trig_only = ] trig_only

[!INCLUDE ssinternalonly-md]

[ @usesqlclr = ] usesqlclr

[!INCLUDE ssinternalonly-md]

Return code values

0 (success) or 1 (failure).

Result set

sp_script_synctran_commands returns a result set that consists of a single nvarchar(4000) column. The result set forms the complete scripts necessary to create both the sp_addsynctrigger and sp_addqueued_artinfo calls to be applied at Subscribers.

Remarks

sp_script_synctran_commands is used in snapshot and transactional replication.

sp_addqueued_artinfo is used for queued updatable subscriptions.

Permissions

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_script_synctran_commands.

Related content