TechnoLearnAcademy

TECHNOLEARN

SQL ALTER Statement ADD CHECK CONSTRAINT

The ALTER Statement is used to add a new constraint to an existing table.

Syntax:      

                  ALTER TABLE  table_name                                                                                                                                                                ADD CONSTRAINT ConstraintName                                                                                                                                                CHECK (condition);

Example:

    Objective: In this example, we will add a check constraint to an existing table emp.
                 ALTER TABLE Tbl_Emp
                 ADD CONSTRAINT check_const
                 CHECK (Len(Dept)>5);
Scroll to Top