sp_setreptable

Description

Enables or disables replication for an Adaptive Server table or displays the current replication status of a table.

Syntax

sp_setreptable [table_name [, {'true' | 'false'} [, {owner_on | owner_off | null}] [, use_index]]]

Parameters

table_name

The name of the table marked for replication.

true

Enables replication for the table.

false

Disables replication for the table.

owner_on

Sets the mode of the table so that both the table name and owner name are considered when the table is marked for replication. Enables tables with the same name but different owner be replicated. This option is for Adaptive Server version 11.5 and later databases.

owner_off

Sets the mode of the table so that only the table name is considered when the table is marked for replication. This is the default. It ensures that the name for each table marked for replication is unique. This option is for Adaptive Server version 11.5 and later databases.

null

Sets the default value of owner_off when you pass it to the owner parameter.

use_index

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

Examples

Example 1

Displays the replication status for all of the tables in the current database:

sp_setreptable

Example 2

Displays the replication status for the publishers table:

sp_setreptable publishers

Example 3

Enables replication for the publishers table:

sp_setreptable publishers, 'true'

Example 4

Allows multiple tables named publishers each owned by different users to be replicated:

sp_setreptable publishers, 'true', owner_on

Example 5

Replicates table named publishers belonging to owner dbo and stored in database pubs2:

sp_setreptable 'pubs2.dbo.publishers', 'true', owner_on

Example 6

Marks the table for replication to use indexes on the text, unitext, image, and rawobject columns, and sets owner status to “off”:

sp_setreptable t1, true, null, use_index

Example 7

Removes the replication status of table t1, and drops the replication indexes if t1 was initially marked for replication to use indexes:

sp_setreptable t1, 'false' 

Usage

Permissions

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

See also

sp_reptostandby, sp_setrepcol, sp_setrepdefmode, sp_setreplicate, sp_setrepproc