- 16


REFERENCES PhonesOwnersKeys;

ALTER TABLE SysSettings

ADD FOREIGN KEY (TimeTalksUsl)

REFERENCES UslsKeys;

ALTER TABLE Talks

ADD FOREIGN KEY (ToPhone)

REFERENCES PhonesKeys;

ALTER TABLE Talks

ADD FOREIGN KEY (Phone)

REFERENCES PhonesKeys;

ALTER TABLE Talks

ADD FOREIGN KEY (DayCode)

REFERENCES TalksPay;

ALTER TABLE TalksPay

ADD FOREIGN KEY (Phone)

REFERENCES PhonesKeys;

ALTER TABLE UslCat

ADD FOREIGN KEY (PKey)

REFERENCES UslCatKeys;

ALTER TABLE UslDivisions

ADD CONSTRAINT R_63

FOREIGN KEY (PKey)

REFERENCES UslDivisionsKeys;

ALTER TABLE UslLgots

ADD CONSTRAINT R_50

FOREIGN KEY (Property)

REFERENCES UslPropsKeys;

ALTER TABLE UslLgots

ADD FOREIGN KEY (Usl)

REFERENCES UslsKeys;

ALTER TABLE UslLgots

ADD FOREIGN KEY (Category)

REFERENCES UslCatKeys;

ALTER TABLE UslProps

ADD CONSTRAINT R_51

FOREIGN KEY (PKey)

REFERENCES UslPropsKeys;

ALTER TABLE Usls

ADD CONSTRAINT R_64

FOREIGN KEY (Division)

REFERENCES UslDivisionsKeys;

ALTER TABLE Usls

ADD FOREIGN KEY (UslType)

REFERENCES UslTypes;

ALTER TABLE Usls

ADD FOREIGN KEY (PKey)

REFERENCES UslsKeys;

CREATE PROCEDURE PrGenUslPropsKeys

RETURNS (ACode INTEGER)

AS

BEGIN

ACode = GEN_ID(genUslPropsKeys, 1);