set repthreshold

Specifies the minimum number of rows that a replicated SQL statement must impact before SQL statement replication is activated for the session.

Syntax

set repthreshold value

Parameters

Examples

Usage

  • The default threshold is 50 rows, which means that Adaptive Server uses SQL statement replication if the DML statement affects at least 51 rows. To use the default threshold, set the threshold parameter to 0. The threshold parameter range is 0 to 10,000.

  • You can invoke set repthreshold within an Adaptive Server stored procedure.

  • The session-level threshold is exportable. Therefore, you can set the export_options setting ‘on’ for a procedure, and set the SQL statement replication threshold, so that procedures in the outer scope use the SQL statement replication threshold set by the stored procedure

  • You can set the session-level threshold either at login by using a “login trigger”, or at the beginning of a batch. Your session settings overwrites the table or database settings.

  • Session-level thresholds are active only for the duration of the session. When you set the threshold inside a stored procedure or a trigger, the settings are reverted back to the table-level or database-level settings when the stored procedure or trigger execution terminates.

  • The threshold set at the session-level overrides the threshold at the table-level and database-level, and the threshold set for any table overrides the threshold set at the database-level.

Related reference
sp_setrepdbmode
sp_setrepdefmode
set repmode