SQL Server Constraints

Constraints are rules that help maintain data and referential integrity.

Data integrity means that the data is valid in the database.

Referential integrity means that the relationships are valid between tables.

Contraints prevent incorrect data from entering into the database.

Constraint Types

#

SQL Server supports different types of constraints.
Click each link for more details.

Constraint Description
Primary Key A column that uniquely identifies each row in a table
Foreign Key A column in one table that uniquely identifies a row in another table
NOT NULL Specifies that the values in a column cannot be NULL
CHECK Specifies that the values in a column must satisfy a condition
UNIQUE Specifies that the values in a column must be unique
DEFAULT Specifies a default value for a column if no value is specified

You may also like



Guides


vsn 3.1