set

Description

Controls replication definition properties for a replicate connection.

Syntax

set {autocorrection | dynamic_sql} {on | off}
 for replication_definition
with replicate at data_server.database

Parameters

autocorrection

Prevents failures that might occur because of missing or duplicate rows in a replicated table. Default is off.

dynamic_sql

Controls whether the table will be considered for dynamic SQL application. Default is on.

on

Enables autocorrection or dynamic SQL for the specified replication definition.

off

Disables autocorrection or dynamic SQL for the specified replication definition.

replication_definition

The name of the replication definition whose autocorrection or dynamic SQL status you are changing.

data_server

The name of the data server with the replicate database for which you are changing the autocorrection or dynamic SQL status. If the replicate database is part of a warm standby application, data_server is the logical data server name.

database

The name of the replicate database where you are changing the autocorrection or dynamic SQL status. If the replicate database is part of a warm standby application, database is the logical database name.

Examples

Example 1

Enables autocorrection for the publishers_rep replication definition in the pubs2 database at the SYDNEY_DS data server:

set autocorrection on
 for publishers_rep
 with replicate at SYDNEY_DS.pubs2

Example 2

Disables dynamic SQL for the publishers_rep replication definition in the pubs2 database at the SYDNEY_DS data server:

set dynamic_sql off
for publishers_rep
with replicate at SYDNEY_DS.pubs2

Usage


How autocorrection works


Autocorrection and replicated stored procedures

NoteIf you use replicated stored procedures to modify primary data, be sure to write stored procedures at the replicate Replication Server to correct for the failed updates and inserts that can occur during non-atomic materialization. Stored procedures at the replicate Replication Server should simulate autocorrection, treating update and insert operations as combined delete-insert operations. Alternatively, stored procedures can correct failed updates and inserts after they are detected.


Autocorrection and replicate minimal columns


Autocorrection and text, unitext, or image datatypes


Autocorrection and bulk copy-in

In normal replication, bulk operation is disabled if autocorrection is on. However, in subscription materialization, bulk copy-in is applied even when autocorrection is enabled except for nonatomic subscriptions recovering from failure.

Permissions

set requires “create object” permission.

See also

alter replication definition, create replication definition, create subscription