Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 530 Bytes

Check.md

File metadata and controls

25 lines (20 loc) · 530 Bytes

Keyword CHECK

AlaSQL supports CHECK table constraints.

Syntax:

    CREATE TABLE table (
        column type CHECK expression
    );

For example:

    CREATE TABLE dbo.Employees (
      empid   INT         NOT NULL PRIMARY KEY,
      mgrid   INT         NULL REFERENCES dbo.Employees,
      empname VARCHAR(25) NOT NULL,
      salary  MONEY       NOT NULL,
      CHECK (empid <> mgrid)
    );

You can use this constraint for whole table or for separate fields.

See also: CONSTRAINT