Ensuring data integrity

If data has integrity, the data is valid—correct and accurate—and the relational structure of the database is intact. Referential integrity constraints enforce the relational structure of the database. These rules maintain the consistency of data between tables. Building integrity constraints into the database is the best way to make sure your data remains consistent.

You can enforce several types of referential integrity checks. For example, you can ensure individual entries are correct by imposing constraints and CHECK constraints on tables and columns. You can also configure column properties by choosing an appropriate data type or setting special default values.

SQL Anywhere supports stored procedures, which give you detailed control over how data enters the database. You can also create triggers, or customized stored procedures that are invoked automatically when a certain action, such as an update of a particular column, occurs.

For more information about procedures and triggers see Using procedures, triggers, and batches.


How your data can become invalid
Building integrity constraints into your database
How the contents of your database change
Tools for maintaining data integrity
SQL statements for implementing integrity constraints
Using column defaults
Using table and column constraints
Using domains
Enforcing entity and referential integrity
Integrity rules in the system tables