Data integrity for SQL Server databases

Source: Internet
Author: User

All data values stored in the database are in the correct state. If an incorrect data value is stored in the database, the database is called lost data integrity.

Detailed explanation

The data in the database is input from the outside world, and the input is invalid or error information due to various reasons. It is the primary concern of the database system, especially the multi-user relational database system, to ensure the input data conform to the regulations. Data integrity is therefore presented. This chapter describes the concept of data integrity and how it is implemented in SQL Server.

Data integrity (Integrity) refers to the accuracy (accuracy) and reliability (reliability) of data. It is intended to prevent the existence of non-conforming data in the database and to prevent invalid operations or error messages due to the input and output of the error message. Data integrity is divided into four categories: entity integrity (Integrity), Domain integrity (Integrity), referential integrity (referential Integrity), User custom integrity (user-definedintegrity).

The database uses several methods to ensure data integrity, including foreign keys, constraints, rules, and triggers. The system handles the relationship of the four well, and uses different methods for different situations to cross-use each other and to complement the shortcomings.

(The above from the Sogou encyclopedia)

ENTITY integrity constraint: Constraint on a column (primary key (PRIMARY key) constraint)

Domain integrity constraints: Constraints on a row (default (defaults) constraint , check constraint,non-null constraint)

Referential integrity constraint: FOREIGN key (foreign key) constraint that is related to the primary key

User-defined constraints: In addition to implicit constraints, the designer of a relational database can also set specific additional constraints on the database, which are called "User-defined constraints"

Data integrity for SQL Server databases

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.