sp_setrepproc

Enables or disables replication for a stored procedure or displays the current replication status of a stored procedure.

Syntax

sp_setrepproc [proc_name [,'false' | 'table' | 
      'function' [,'log_current' | 'log_sproc']]]

Parameters

Examples

Usage

  • Use sp_setrepproc with no parameters to display all replicated stored procedures in the database.

  • Use sp_setrepproc proc_name with no other parameters to display the current replication status of the stored procedure.

  • If you are using Adaptive Server version 11.5 or later, supported DDL commands and stored procedures executed inside a user stored procedure are copied to the standby database if the procedure is enabled for replication with sp_setrepproc.

    Supported DDL commands and stored procedures executed inside a user stored procedure are not copied to the standby database if the procedure is not enabled for replication with sp_setrepproc.

  • Because Adaptive Server starts a transaction to execute replicated stored procedures, keep these points in mind when you design procedures:
    • If a replicated stored procedure contains DDL commands (for example, create table), Adaptive Server Enterprise generates an error unless the database option “DDL-in-Tran” is enabled on the database.

    • If the replicated stored procedure contains transactions and rollback commands that roll back the transaction, the rollback command rolls back the execution of the entire procedure.

    • Because of the outer transaction, Adaptive Server holds all the locks until the execution of the procedure is complete.

Related reference
sp_reptostandby
sp_setreplicate
sp_setreptable