ALTER TABLE TCApplications
	ADD FOREIGN KEY (TCApplicationCauseID)
	REFERENCES TCApplicationCauses  (TCApplicationCauseID)

ALTER TABLE TCApplications
	ADD FOREIGN KEY (ConsumingObjectID)
	REFERENCES ConsumingObjects(ID)

ALTER TABLE TCApplications
	ADD FOREIGN KEY (LegalEntityID)
	REFERENCES LegalEntities(LegalEntityID)

ALTER TABLE TCApplications
	ADD FOREIGN KEY (ParentApplicationID)
	REFERENCES TCApplications

ALTER TABLE TCApplications
	ADD FOREIGN KEY (RefusalReasonID)
	REFERENCES TCApplicationRefusalReasons  (TCApplicationRefusalReasonID)

ALTER TABLE TCApplications
	ADD FOREIGN KEY(ExecutorID) 
		REFERENCES Персонал(Код_работника)