rs_send_repserver_cmd

Description

Executes replication definition change requests directly at the primary database.

Syntax

rs_send_repserver_cmd ‘rs_api

Parameters

rs_api

Contains the replication definition Replication Command Language (RCL) command and parameters you specify for rs_send_repserver_cmd. rs_api is a varchar parameter with a maximum length of 16370 bytes for Adaptive Server, 4000 bytes for Oracle, and 8000 bytes for Microsoft SQL Server.

Enclose rs_api in single quotes, and replace each single quote inside the string with two single quotes.

If the parameter length for rs_api is too short for a create or alter replication definition request, you can split the request into two or more requests.

Examples

Example 1

Execute the “authors” alter replication definition request at the primary database to drop the address, city, state, and zip columns:

exec rs_send_repserver_cmd ‘alter replication
definition authors drop address, city, state, zip’

Example 2

If a replication definition RCL is longer than the maximum length allowed for rs_api, you can split the request into two or more requests.

exec rs_send_repserver_cmd ‘alter replication
definition authors drop address, city’ 
go
exec rs_send_repserver_cmd ‘alter replication
definition authors drop state, zip’

Example 3

In this example, you need to enclose “authors” in double quotes, and ‘off’ in two single quotes:

exec rs_send_repserver_cmd ‘alter replication definition “authors” replicate sqldml ‘‘off’’’

Usage

WARNING! As Replication Server accepts all commands that Replication Agent sends to Replication Server, you must control access to rs_send_repserver_cmd at the primary database.

See also

alter replication definition, create replication definition, drop replication definition, alter applied function replication definition, create applied function replication definition, alter request function replication definition, create request function replication definition, admin verify_repserver_cmd, sysadmin skip_bad_repserver_cmd