sp_setrepdbmode

Enables or disables replication of SQL statements at the database-level and for one or more specific DML operation type.

Syntax

sp_setrepdbmode dbname [, “option [option [...]]” [, “on” | “off”] 
   [‘threshold’, ‘value’]
option ::= { U | D | I | S }

Parameters

Examples

Usage

  • You can set SQL statement replication at the database level only when the database has been marked for replication by setting sp_reptostandby to ALL or L1.

  • 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 configure replication at the database-level and set the threshold for SQL statement replication at the database-level at the same time. For example:

    sp_reptostandby pubs2, ‘none’
    go
    sp_setrepdbmode pubs2, ‘threshold’
    go

    However, you cannot configure replication at the database-level and define operations also at the database-level as SQL statement replication at the database-level requires that the entire database be replicated and you cannot replicate the operations only. For example, you cannot execute:

    sp_reptostandby pubs2, ‘none’
    go
    sp_setrepdbmode pubs2, ‘udis’, ‘on’
    go
  • 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
set repmode
sp_setrepdefmode
set repthreshold