sp_setrepdbmode

Description

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”]]
option ::= { U | D | I | S }

Parameters

dbname

The name of the database for which you want to enable SQL statement replication.

option

Any combination of these DML operations:

  • U – update

  • D – delete

  • I – insert select

  • S – select into

When the database replication mode is set to any combination of UDIS the RepAgent sends both individual log records and the information needed by Replication Server to build the SQL statement.

on

Enables SQL replication of the DML operation specified.

of"

Diables SQL statement replication at the database level for all types of DML operations, regardless of the operation specified in option.

Examples

Example 1

Replicates delete and select into statements:

sp_setrepdbmode pdb, 'DS', 'on'

Example 2

Displays the current SQL replication settings:

1> sp_setrepdbmode pdb1
2> go
The replication mode for database 'pdb1' is 'us'.
(return status = 0)

Example 3

To disable replication of all SQL statements at database level, use:

sp_setrepdbmode pdb, 'D', 'off'

Usage

See also

set repmode, sp_setrepdefmode