set autocorrection

Description

Prevents failures that would otherwise be caused by missing or duplicate rows in a replicated table.

Syntax

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

Parameters

on

Enables autocorrection for the specified replication definition.

off

Disables autocorrection for the specified replication definition.

replication_definition

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

data_server

The name of the data server with the replicate database for which you are changing the autocorrection 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 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

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

Permissions

set autocorrection requires “create object” permission.

See also

alter replication definition, create replication definition, create subscription