Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Remote » Principles of SQL Remote Design » How statements are replicated

Replication of procedures Next Page

Replication of triggers


By default, the Message Agent does not replicate actions performed by triggers; it is assumed that the trigger is defined remotely. This avoids permissions issues and the possibility of each action occurring twice. There are some exceptions to this rule:

An option to replicate trigger actions

The Message Agent has an option that causes it to replicate all trigger actions when sending messages. This is the dbremote -t option.

If you use this option, you must ensure that the trigger actions are not carried out twice at remote databases, once by the trigger being fired at the remote site, and once by the explicit application of the replicated actions from the consolidated database.

To ensure that trigger actions are not carried out twice, you can wrap an IF CURRENT REMOTE USER IS NULL ... END IF statement around the body of the triggers or you can set the SQL Anywhere fire_triggers option to Off for the Message Agent user ID.