--- title: "Control behavior of triggers & constraints in synchronization" description: Learn how to prevent triggers from executing or constraints from being enforced during the synchronization of a SQL Server Replication Publication. ms.custom: seo-lt-2019 ms.date: "03/16/2017" ms.prod: sql ms.prod_service: "database-engine" ms.reviewer: "" ms.technology: replication ms.topic: conceptual dev_langs: - "TSQL" helpviewer_keywords: - "identities [SQL Server replication]" - "constraints [SQL Server], replication" - "triggers [SQL Server], replication" - "triggers [SQL Server replication]" - "constraints [SQL Server replication]" - "NOT FOR REPLICATION option" - "NFR option" ms.assetid: 7c4e0f0e-cadc-4c99-98f4-69799b9b356b author: "MashaMSFT" ms.author: "mathoma" monikerRange: "=azuresqldb-mi-current||>=sql-server-2016||=sqlallproducts-allversions" --- # Control Behavior of Triggers and Constraints in Synchronization [!INCLUDE[appliesto-ss-asdbmi-xxxx-xxx-md](../../includes/appliesto-ss-asdbmi-xxxx-xxx-md.md)] During synchronization, replication agents execute [INSERT (Transact-SQL)](../../t-sql/statements/insert-transact-sql.md), [UPDATE (Transact-SQL)](../../t-sql/queries/update-transact-sql.md), and [DELETE (Transact-SQL)](../../t-sql/statements/delete-transact-sql.md) statements on replicated tables, which can cause data manipulation language (DML) triggers on these tables to be executed. There are cases when you may need to prevent these triggers from firing or constraints from being enforced during synchronization. This behavior depends on how the trigger or constraint is created. ### To prevent triggers from executing during synchronization 1. When creating a new trigger, specify the NOT FOR REPLICATION option of [CREATE TRIGGER (Transact-SQL)](../../t-sql/statements/create-trigger-transact-sql.md). 2. For an existing trigger, specify the NOT FOR REPLICATION option of [ALTER TRIGGER (Transact-SQL)](../../t-sql/statements/alter-trigger-transact-sql.md). ### To prevent constraints from being enforced during synchronization 1. When creating a new CHECK or FOREIGN KEY constraint, specify CHECK NOT FOR REPLICATION option in the constraint definition of [CREATE TABLE (Transact-SQL)](../../t-sql/statements/create-table-transact-sql.md). ## See Also [Create Tables (Database Engine)](../../relational-databases/tables/create-tables-database-engine.md)