Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 2.77 KB

publish-execution-of-stored-procedure-in-transactional-publication.md

File metadata and controls

43 lines (31 loc) · 2.77 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom helpviewer_keywords monikerRange
Publish execution of stored procedure (Transactional)
Learn how to publish the execution of stored procedures using SQL Server Management Studio.
MashaMSFT
mathoma
09/25/2024
sql
replication
how-to
updatefrequency5
publishing [SQL Server replication], stored procedure execution
stored procedures [SQL Server replication], publishing
=azuresqldb-mi-current||>=sql-server-2016

Publish Execution of Stored Procedure in Transactional Publication

[!INCLUDEsql-asdbmi] Specify that the execution of a stored procedure (rather than just its definition) should be published in the Article Properties - <Article> dialog box. This dialog box is available in the New Publication Wizard and the Publication Properties - <Publication> dialog box. For more information about using the wizard and accessing the dialog box, see Create a Publication and View and Modify Publication Properties.

The definition of the procedure (the CREATE PROCEDURE statement) is replicated to the Subscriber when the subscription is initialized; when the procedure is executed at the Publisher, replication executes the corresponding procedure at the Subscriber.

To publish the execution of a stored procedure

  1. On the Articles page of the New Publication Wizard or the Publication Properties - <Publication> dialog box, select a stored procedure.

  2. Click Article Properties, and then click Set Properties of Highlighted Stored Procedure.

  3. In the Article Properties - <Article> dialog box, specify one of the following values for the Replicate option:

    • Execution of the stored procedure

    • Execution in a serialized transaction of the SP

      This is the recommended option, because it replicates the procedure execution only if the procedure is executed within the context of a serializable transaction. If the stored procedure is executed outside of a serializable transaction, changes to data in published tables are replicated as a series of data manipulation language (DML) statements.

  4. Select OK.

  5. If you are in the Publication Properties - <Publication> dialog box, click OK to save and close the dialog box.

Related content