Dofactory.com
Dofactory.com
Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

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



Last updated on Dec 21, 2023

Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.