Database-level

Use sp_setrepdbmode and sp_reptostandby to enable SQL statement replication at the database-level.


sp_setrepdbmode

Use sp_setrepdbmode to enable SQL statement replication at the database-level for a specific DML operation. The DML operations that apply to SQL statement replication include:

For example, to replicate delete statements as SQL statements and also enable replication of select into, enter:

sp_setrepdbmode pdb, 'DS', 'on'

When an user executes a delete on a table in database pdb, Adaptive Server logs additional information for SQL statement replication. The RepAgent sends both individual log records, and the information needed by the Replication Server, to build the SQL statement.You can set SQL statement replication at the database level only when the database has been marked for replication by setting sp_setreptostandby to ALL or L1.

The threshold parameter defines the minimum number of rows that a DML statement must affect, to activate SQL statement replication. The default threshold is 50 rows, which means that Adaptive Server automatically uses SQL statement replication if the DML statement affects at least 51 rows. See “Setting SQL statement replication threshold”.

For example, to set the threshold at the database-level to trigger SQL statement replication when a data manipulation language (DML) statement affects more than 100 rows:

sp_setrepdbmode pubs2, ‘threshold’, ‘100’
go

See Chapter 5, “Adaptive Server Commands and System Procedures” in the Replication Server Reference Manual for details on the syntax and usage.


sp_reptostandby

Use sp_reptostandby to display the SQL statement replication status at the database level. For example:

sp_reptostandby pdb
go
The replication status for database 'pdb' is 'ALL'.
The replication mode for database 'pdb' is 'off'.