StatCounter

View My Stats

Monday, February 4, 2008

Enable and Disable a Constraint in Table-SQL Server

The query as Follows:

Disable a constraint on a Table:

Alter table TableName nocheck constraint ConstraintName

Enable a constraint on a Table:

Alter table TableName check constraint ConstraintName

While Disabling a constaints: For Example Consider The colum of integer field have primary key constraints.Its functionality wont allow the duplicate values in that column.
After disabling the constraints....It allows the duplicate value in that column.
You can Enable and disable the constraints as per needs
Whi

No comments: