Contents Index Constant expression defaults Using CHECK constraints on columns

ASA SQL User's Guide
  Ensuring Data Integrity

Using table and column constraints


Along with the basic table structure (number, name and data type of columns, name and location of the table), the CREATE TABLE statement and ALTER TABLE statement can specify many different table attributes that allow control over data integrity. Constraints allow you to place restrictions on the values that can appear in a column, or on the relationship between values in different columns. Constraints can be either table-wide constraints, or can apply to individual columns.

Caution    Altering tables can interfere with other users of the database. Although you can execute the ALTER TABLE statement while other connections are active, you cannot execute the ALTER TABLE statement if any other connection is using the table you want to alter. For large tables, ALTER TABLE is a time-consuming operation, and all other requests referencing the table being altered are prohibited while the statement is processing.

This section describes how to use constraints to help ensure the accuracy of data in the table.


Using CHECK constraints on columns
Using CHECK constraints on tables
Inheriting column CHECK constraints from domains
Working with table and column constraints in Sybase Central
Modifying and deleting CHECK constraints

Contents Index Constant expression defaults Using CHECK constraints on columns