SQL Server - Turn FOREIGN key constraint OFF/ON

To turn the constraint off...

ALTER TABLE <table name> NOCHECK CONSTRAINT <constraint_name>

and to turn it back on...

ALTER TABLE <table name> CHECK CONSTRAINT <constraint_name>

0 comments: