VistaDB 5
Adding a Foreign Key

Creating using SQL Syntax

The dialog below is the same as executing the following SQL syntax.

ALTER TABLE [Timesheets]
ADD
CONSTRAINT [FK_Timesheet_Employees] FOREIGN KEY ([EmployeeID])
REFERENCES [Employees] ([EmployeeID])
ON UPDATE CASCADE
ON DELETE CASCADE;

Creating using Data Builder

Adding a Foreign Key to a table is performed through the Data Builder by right clicking on the Foreign Keys folder under the table you wish the key to be applied and selecting Create Foreign Key. This will bring up a dialog that allows you to edit the settings of the Foreign Key.

See Also