sp_setrepcol

Description

Sets or displays the replication status for text and image columns.

Syntax

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

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 or image column in the table. Specify null for the column name to set the replication status of all text and image columns in the table.

do_not_replicate

Prevents Adaptive Server from logging replication information for the text and image column.

always_replicate

Causes Adaptive Server to log replication information for the text and image column when any column in the row changes. This status adds overhead for replicating text and 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 and image column only when the text and image column data changes. This status reduces overhead, but it may lead to data inconsistency from row migration or changes during non-atomic materialization.

Examples

Example 1

Displays the replication status for all text and 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 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 or image columns.)

sp_setrepcol au_pix, pic, replicate_if_changed

Example 4

Specifies that all text and image columns in the au_pix table should have the replicate_if_changed status.

sp_setrepcol au_pix, null, replicate_if_changed

Usage

Permissions

sp_setrepcol requires sa or dbo permission or replication_role.

See also

sp_reptostandby, sp_setreplicate, sp_setreptable