Skip to content
Mathias Rangel Wulff edited this page Jun 12, 2015 · 2 revisions

Keyword UNIQUE

AlaSQL supports UNIQUE constraints.

For example:

CREATE TABLE dbo.BOM
(
  partid     INT           NOT NULL REFERENCES dbo.Parts,
  assemblyid INT           NULL     REFERENCES dbo.Parts,
  unit       VARCHAR(3)    NOT NULL,
  qty        DECIMAL(8, 2) NOT NULL,
  UNIQUE(partid, assemblyid),
  CHECK (partid <> assemblyid)
);
Clone this wiki locally