I have three tables: A, AB and B.
A.ID and B.ID are int primary keys. AB.AID and AB.BID are int and (AID, BID) is the primary key of AB.
I need to make sure that AB.AID will be a foreign key which will reference A(ID) and AB.BID will be a foreign key which will reference B(ID).
If I, using Microsoft SQL Server Management Studio right-click the table and click Design and after the table appears I right-click and click on Relationships and add the foreign key, will I have the very same result as if I would:
Create a temporary
tablewith the same structureMigrate all records from AB there
Remove all records from AB
Change the structure of AB to have two
foreign keysCopy the data back
Remove the temporary
table
?