Show TOC

sysadmin apply_truncate_tableLocate this document in the navigation structure

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
data_server

The name of the replicate data server.

database

The name of the replicate database managed by the data server.

table_owner

Identifies the owner of the replicate table. If owner is not specified, Replication Server sets owner to “dbo.”

table_name

Identifies the replicate table for which you want to turn on or off the “subscribe to truncate table” option for existing subscriptions.

on

Turns on the “subscribe to truncate table” option for existing subscriptions.

off

Turns off the “subscribe to truncate table” option for existing subscriptions.

Examples
Example 1

Turns on “subscribe to truncate table” for all subscriptions to the <publishers> table owned by <emily> in the <pubs2> database:

sysadmin apply_truncate_table, SYDNEY_DS,
 pubs2, emily, publishers, 'on'
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.