sp_setrepcol

Description

Sets or displays the replication status for text, unitext, or image columns.

Syntax

sp_setrepcol table_name [, {column_name | null}
	 [, {do_not_replicate | always_replicate | replicate_if_changed}]]
              [, use_index]

Parameters

table_name

The name of the replicated table. You must enable replication for the table using sp_setreptable before you execute sp_setrepcol.

column_name

The name of a text, unitext, or image column in the table. Specify null for the column name to set the replication status of all text, unitext, or image columns in the table.

do_not_replicate

Prevents Adaptive Server from logging replication information for the text, unitext, or image column. If the column has previously been marked to use an index for replication, setting do_not_replicate removes the index.

always_replicate

Causes Adaptive Server to log replication information for the text, unitext, or image column when any column in the row changes. This status adds overhead for replicating text, unitext, or image columns that do not change; however, it protects against data inconsistency from row migration or changes during non-atomic materialization.

replicate_if_changed

Causes Adaptive Server to log replication information for the text, unitext, or image column only when the text, unitext, or image column data changes. This status reduces overhead, but it may lead to data inconsistency from row migration or changes during non-atomic materialization.

use_index

Marks the column to use an index for replication on text, unitext, image, or rawobjects columns.

Examples

Example 1

Displays the replication status for all text, unitext, or image columns in the au_pix table. au_pix must be marked for replication using sp_setreptable.

sp_setrepcol au_pix

Example 2

Displays the replication status for the pic column in the au_pix table. pic must be a text, unitext, or image datatype column.

sp_setrepcol au_pix, pic

Example 3

Specifies that the pic column (image datatype) in the au_pix table should have the replicate_if_changed status. (In this particular table in the pubs2 database, there are no other text, unitext, or image columns.)

sp_setrepcol au_pix, pic, replicate_if_changed

Example 4

Specifies that all text, unitext, or image columns in the au_pix table should have the replicate_if_changed status.

sp_setrepcol au_pix, null, replicate_if_changed

Example 5

Marks the column t (text datatype) as replicate_if_changed and uses an index for replication:

sp_setrepcol t1, t, replicate_if_changed, use_index

Usage

Permissions

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

See also

sp_reptostandby, sp_setreplicate, sp_setreptable