SQL Server: Tips and Tricks - 2 (2017)
Constraints in SQL Server
In simple words, Constraints define rules those we implement to avoid insertion of any data that does not follow the rule.
By using the Constraint, we can validate the data and if complies the rule, It will be inserted in table otherwise rolled back.
Constraints are used to maintain Data Integrity. They make sure the data entered follow the rules we have defined.
There are different types of Constraints available in SQL Server.
1. Not Null Constraint
2. Check Constraint
3. Default Constraint
4. Unique Constraints
5. Primary Key Constraint
6. Foreign Key Constraint
All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)
If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.
© 2016-2025 All site design rights belong to S.Y.A.