What is Constraint and SQL Server Constraint Types(TSQL)

 

Constaint allows us to set specific rules for data in a table. For example; to make sure that the data in a column is between certain values.

A constraint can affect only a column, but it can also affect the entire table. We can define Constraints in the stage of creating the table or after creating the table.

Here are the most common types of constraint used in SQL Server:

NOT NULL Constraint NOT NULL Constraint in SQL Server(TSQL)
DEFAULT Constraint How To Create Default Constraint On SQL Server
UNIQUE Constraint What is Unique Constraint
Primary Key and Foreign Key What is Primary Key and Foreign Key
CHECK Constraint How To Create CHECK CONSTRAINT
INDEX Index Concept and Performance Effect on SQL Server

dbtut
Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *