create table SaleOrderLines_Articles (
  "N" integer not null default autoincrement,
  "SaleLineID" integer not null,
  "InvoiceNo" integer not null,
  "ArticleNo" integer not null
)

GO

ALTER TABLE SaleOrderLines_Articles
ADD NOT NULL FOREIGN KEY "ART_SaleID" ("InvoiceNo","ArticleNo")
REFERENCES "Articles" ("InvoiceNo","ArticleNo")
ON UPDATE CASCADE
ON DELETE CASCADE

GO

ALTER TABLE SaleOrderLines_Articles
ADD NOT NULL FOREIGN KEY "ART_SaleID_N" ("SaleLineID")
REFERENCES "SaleOrderLines" ("Id")
ON UPDATE CASCADE
ON DELETE CASCADE

GO

