NOCHECK

NOCHECK is a constraint in SQL Server that allows operations to bypass the enforcement of a specific constraint or all constraints for a table. When a constraint is set to NOCHECK, the database engine does not verify whether existing data in the table complies with the constraint.

Example

ALTER TABLE SalesOrderDetail NOCHECK CONSTRAINT FK_SalesOrderDetail_Product_ProductID

Output

Command(s) completed successfully.

Explanation

The above SQL command disables the foreign key constraint named FK_SalesOrderDetail_Product_ProductID on the SalesOrderDetail table. Any INSERT, UPDATE, or DELETE operations will not check this constraint until it is enabled again. This can be used to improve performance for bulk operations. After operations complete, it is advised to enable the constraint using the CHECK CONSTRAINT command.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.