Enables or disables replication for an Adaptive Server table or displays the current replication status of a table.
sp_setreptable [table_name [, {'true' | 'false'} [, {owner_on | owner_off | null}] [, use_index]]]
The name of the table marked for replication.
Enables replication for the table.
Disables replication for the table.
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.
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.
Sets the default value of owner_off when you pass it to the owner parameter.
Marks the table to use an index for replication on text, unitext, image, or rawobjects columns.
Displays the replication status for all of the tables in the current database:
sp_setreptable
Displays the replication status for the publishers table:
sp_setreptable publishers
Enables replication for the publishers table:
sp_setreptable publishers, 'true'
Allows multiple tables named publishers each owned by different users to be replicated:
sp_setreptable publishers, 'true', owner_on
Replicates table named publishers belonging to owner dbo and stored in database pubs2:
sp_setreptable 'pubs2.dbo.publishers', 'true', owner_on
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
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'
Use sp_setreptable with no parameters to display a list of replicated tables in the database.
Use sp_setreptable table_name without true or false to display the current replication status of the table.
When you include the owner_on option, multiple tables with the same table name but different owners may be replicated to replicate and warm standby databases. Make sure that the replication definition on the table also includes owner information or replication may fail.
If a table has been marked for replication with sp_setreptable, you can change the owner mode with the sp_setrepdefmode system procedure.
The replication index status order of precedence is: column, table, database. For example, in a database marked for replication using indexes, the table’s status overrides the index status.
When a large table containing one or more text, unitext, image, or rawobject columns is marked for replication, the internal process is performed in a single transaction and may take a long time. To speed up the process, use the use_index option to create a global nonclustered index for every text, unitext, image, or rawobject column.
With use_index, a shared-table lock is held while the global nonclustered index is created.
You cannot use drop index to manually drop indexes created for text, unitext, image, or rawobject replication. You can use only the supported replication stored procedures sp_reptostandby, sp_setreptable, and sp_setrepcol to change the replication index status.
sp_setreptable requires “sa” or “dbo” permission or replication_role.
sp_reptostandby, sp_setrepcol, sp_setrepdefmode, sp_setreplicate, sp_setrepproc