- 
                Notifications
    You must be signed in to change notification settings 
- Fork 689
Check
        Mathias Rangel Wulff edited this page Jun 12, 2015 
        ·
        3 revisions
      
    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
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo