sp_setrepdefmode

Changes or displays the owner status of tables marked for replication, and enables or disables table-level SQL statement replication for a specific DML operation.

Syntax

sp_setrepdefmode table_name [, 'owner_on' | 'owner_off' | 
   ‘SQLDML_option [SQLDML_option [ ...]]’ [, ‘on’ | ‘off’ | ‘never’ ] | 
   ‘threshold’, ‘value’]
SQLDML_option ::= { U | D | I }

Parameters

Examples

Usage

  • Use sp_setrepdefmode with RepAgent-enabled Adaptive Server databases.

  • If sp_setrepdefmode is executed with the table name only, it displays the SQL replication settings and owner status of the table.

  • Use sp_setrepdefmode to change the mode of the table. You cannot change the owner mode of tables with sp_setreptable.

  • If the owner_off option is supplied and the current mode of the table is “owner on,” sp_setrepdefmode checks that the table name is unique among all replicated tables in owner off mode. If the name is unique, sp_setrepdefmode changes the table mode to owner off. If the name is not unique, the procedure fails.

  • 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.

Permissions

sp_setrepdefmode requires “sa” or “dbo” permission or replication_role.

Related reference
set repmode
sp_setreptable
sp_setrepdbmode
set repthreshold