sysadmin apply_truncate_table

Turns on or off the “subscribe to truncate table” option for all existing subscriptions to a particular table, enabling or disabling replication of truncate table.

Syntax

sysadmin apply_truncate_table, data_server,
 database, {table_owner | '' | ""}, table_name 
{'on'| 'off'} 

Parameters

Examples

Usage

  • Use sysadmin apply_truncate_table with Adaptive Server version 11.5 or later databases.

  • If you did not specify a replicate table owner in the replication definition, enter '' (two single-quote characters) or "" (two double-quote characters) for the table owner name.

  • Subscriptions for a particular table for a particular database must all support or not support replication of truncate table. If, for example, sysadmin apply_truncate_table is off, you cannot create new subscriptions that include the “subscribe to truncate table” option unless you turn sysadmin apply_truncate_table on for all subscriptions for that table.

    See create subscription or define subscription for more information about setting the “subscribe to truncate table” option for new subscriptions.

  • Replication Server executes truncate table at the replicate database as the maintenance user. Among the permissions granted to maintenance user is “replication_role.” If you revoke maintenance user’s “replication_role,” you will be unable to replicate truncate table unless
    • The maintenance user has been granted “sa_role,”

    • The maintenance user owns the table, or

    • The maintenance user is aliased as the Database Owner.

  • It is not necessary for warm standby databases to subscribe to truncate table; execution of the truncate table command is automatically replicated to standby databases. Turn on replication of truncate table for standby databases with the alter logical connection command.

Permissions

sysadmin apply_truncate_table requires “sa” permission.

Related reference
create subscription
define subscription