 |
|
SQL Server Tips by Burleson |
Data Integrity
Data Integrity, when referring to databases, is a concept that data
in the database must be correct and accurate.
The quality criteria of data:
* Accuracy - how accurate is the stored data compared to the real
world data.
* Completeness - what data is missing from the real world data.
* Consistency - how consistent is the stored data regarding data
constraints and related data.
* Currentness - how up to date is the stored data compared to the
real world data.
Data Integrity has four components:
* Entity Integrity
* Domain Integrity
* Referential Integrity
* Business rules
Entity Integrity - means that there is a mechanism that will allow
only uniquely identified rows in a table. This is done with either
primary keys or unique keys that will prevent duplicate rows.
Domain Integrity - means that there is a mechanism that will
restrict the data within certain boundaries. Besides the data types
having their own limitations on the nature and size or range
permitted there are also constraints. Constraints can be rules or
checks that will only accept data with a certain format or within a
certain range. The formula used by the rule or check is an
expression that might use data from the table itself for its
calculations.
Referential Integrity - means that there is a mechanism that will
keep the data in related tables synchronized.
Business rules - rules that are particular to a specific
application. Triggers can go a step further than checks and rules by
allowing expressions that can get data from other tables and even
call SP's or XP's, making them very useful for this situation.
The above book excerpt is from:
Super SQL
Server Systems
Turbocharge Database Performance with C++ External Procedures
ISBN:
0-9761573-2-2
Joseph Gama, P. J. Naughter
http://www.rampant-books.com/book_2005_2_sql_server_external_procedures.htm |