Create Foreign Keys
Foreign keys can be defined to indicate a relationship between two tables. Foreign keys can be created using either of two methods.
Create a Foreign Key using a Dialog Box:
In Database Explorer, right click the Foreign Keys node under the table you wish to add the foreign key to.
Select Add Foreign Key from the ensuing popup menu.
Use the dialog box that appears to define the foreign key. See the links below for more information.
Click Ok to create the foreign key and add it to the table.
Create a Quick Foreign Key:
In a diagram, right click on the table you wish to add a foreign key to.
In the popup menu, click Add Quick Foreign Key and then select the parent table of this foreign key.
DbWrench will automatically add the primary key column(s) from the parent table to the child table if those columns are not present in the child table.
A primary key must be defined on the parent table before using the Quick Foreign Key method.
See also: