How to create a FOREIGN KEY constraint using a database diagram (Enterprise Manager)
To create a FOREIGN KEY constraint using a database diagram
- Open a database diagram.
- If you have not already defined a PRIMARY KEY or UNIQUE constraint in the foreign key table, do so now.
- In the foreign key table, create a column.
The foreign key column must match the data type and size of the primary key column, with these exceptions:
- A char column or sysname column can relate to a varchar column.
- A binary column can relate to a varbinary column.
- A user-defined data type can relate to its base type.
- Click the primary key columns that you want to copy to the foreign key table.
- Copy the columns from the primary key table to the foreign key table.
See Also
(c) 1988-98 Microsoft Corporation. All Rights Reserved.