sp_setrepdefmode

Description

sp_setrepdefmode includes options to:

Syntax

sp_setrepdefmode tabname [, owner_on | owner_off | '{UDI}' , [‘on' | 'off' | 'never' | ‘threshold’ [, 'value']]]

Parameters

Examples

Example 1 In this example, the update and delete statements on table t use SQL statement replication if the statement affects at least 101 rows:

sp_setreptable t, true
go
sp_setrepdefmode t, 'UD', 'on'
go
sp_setrepdefmode t, 'threshold','100'
go

Example 2 This example illustrates how table-level settings override the database level settings. Update, delete, and insert select statements on table t are replicated using SQL statement replication, while select into statements are replicated using traditional replication:

sp_reptostandby pdb, 'ALL'
go
sp_setrepdbmode pdb, 'S', 'on'
go
sp_setreptable t, true
go
sp_setrepdefmode t, 'UDI', 'on'
go

Example 3 In this example, database pdb is configured to use SQL statement replication for delete statements. However, table t uses SQL statement replication only for update and insert select statements.

sp_reptostandby pdb, 'ALL'
go
sp_setrepdbmode pdb, 'D', 'on'
go
sp_setreptable t, true
go
sp_setrepdefmode t, 'UI', 'on'
go

Example 4 The example below retrieves threshold settings:

sp_setrepdbmode t, 'threshold'
go
The replication threshold for table 't' is '90'.

Example 5 The example below illustrates how to set the threshold to the default value:

sp_setrepdbmode t, 'threshold', '0'

Usage

NoteYou cannot set select into at the object level; the target table does not yet exist.

See also

sp_reptostandby