WHAT IS A "CONSTRAINT"?

Pushpendra Singh

Total Post:241

Points:1205
Posted by  Pushpendra Singh
 1315  View(s)
Ratings:
Rate this:
  1. Pushpendra Singh

    Post:241

    Points:1205
    What is a "constraint"?

    A constraint allows you to apply simple referential integrity checks to a table. There are four primary types of constraints that are currently supported by SQL Server: PRIMARY/UNIQUE - enforces uniqueness of a particular table column. DEFAULT - specifies a default value for a column in case an insert operation does not provide one. FOREIGN KEY - validates that every value in a column exists in a column of another table. CHECK - checks that every value stored in a column is in some specified list. Each type of constraint performs a specific type of action. Default is not a constraint. NOT NULL is one more constraint which does not allow values in the specific column to be null. And also it the only constraint which is not a table level constraint.

  1. Amit Singh

    Post:565

    Points:2825
    What is a "constraint"?

    A constraint is an expression that specifies the semantics of an element, and it must always be true.

    Constraint is a restriction on table.There are two types of 
    constraints 1.ananymous constraint and 2.named
    constraint.under named and ananymous constraints there are
    1.primary key constraint
    2.foreign key constraint
    3. not null constraint
    4. check constraint
    5. unique constraint.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!