简体   繁体   中英

SQL Server Triggers and Replication

I have a trigger on update of a table that inserts into another table. This other table only exists in one location (the table is not replicated). If I set the trigger as not for replication, will my update trigger still fire when replicated data comes in to the table with the trigger? That way I can have the trigger and the tables that it inserts into in only one location.

No: this is the point of NOT FOR REPLICATION . From MSDN

  • Triggers

The trigger is not executed when a replication agent performs an insert, update, or delete operation.

The key here is "replication agent": this is the process that makes the trigger not fire

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM