Disable Foreign Key Constraints for Replication
Applies To: SQL Server 2016
You can disable foreign key constraints for replication in SQL Server 2016 by using SQL Server Management Studio or Transact-SQL. This can be useful if you are publishing data from a previous version of SQL Server.
In This Topic
Before you begin:
To disable a foreign key constraint for replication, using:
Requires ALTER permission on the table.
In Object Explorer, expand the table with the foreign key constraint you want to modify, and then expand the Keys folder.
Right-click the foreign key constraint and then click Modify.
In the Foreign Key Relationships dialog box, select a value of No for Enforce For Replication.
- To perform this task in Transact-SQL, drop the foreign key constraint. Then add a new foreign key constraint and specify the NOT FOR REPLICATION option.
For more information, see ALTER TABLE (Transact-SQL).