It limits the value range which is mentioned in column.
Example of check constraint
CREATE TABLE Persons
(
PId int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
CONSTRAINT chkPerson CHECK (PId>0 AND City='dehradun')
)
SQL CHECK Constraint on ALTER TABLE
ALTER TABLE Emp
ADD CHECK (PId>0)
To DROP a CHECK Constraint
ALTER TABLE Emp
DROP CHECK chk_Person
0 Comment(s)