SQL Server: Constraints

 SQL Server     sbo     Updated on Sep 11, 2014     VIKRAM     394   

Introduction:

In this article i will explain what is Constraint. And how many Constraints available in SQL Server.

Description:

In previous articles i explained Temporary Table and other SQL Server topics. Now i will explain what is Constraint. And how many Constraints available in SQL Server.

Constraint:

A Constarint is condition which is imposed on the data. Constraints define rules regarding the values allowed in columns and are the standard mechanism for enforcing integrity. 

SQL Server supports the following classes of constraints:

  1. NOT NULL
  2. CHECK
  3. UNIQUE
  4. PRIMARY KEY
  5. FOREIGN KEY
  6. DEFAULT

Note: 

The query optimizer also uses constraint definitions to build high-performance query execution plans.

  Related Articles
SQL Server: DEFAULT Constraint
SQL Server: FOREIGN KEY Constraint
SQL Server: PRIMARY KEY Constraint
SQL Server: UNIQUE Constraint
SQL Server: CHECK Constraint
  Recent Articles
SQL Server: DEFAULT Constraint
SQL Server: FOREIGN KEY Constraint
SQL Server: PRIMARY KEY Constraint
SQL Server: UNIQUE Constraint
SQL Server: CHECK Constraint