Toad World® Forums

foreign keys


#1

Using Toad on a model for SQL 2008. I have an auto-incrementing column assigned as my primary key. My alternate key is actually the column I want to use in the foreign key relationship but each time I draw the relationship, it uses the primary key. Does the parent side of a foreign key always have to be the primary key?


#2

It’s possible to assign alternate key as the parent.


#3

i’m having trouble getting the parent side to use an alternate key. can anyone help me with the process?


#4

Double click on the relationship line, go to Foreign Keys tab. You will see a dropdown for Parent Key, select the alternate key here. Then click Apply and Ok. See the screenshot, pk_T_FILM is the PK and title-director is an alternate key.

[cid:image001.png@01CAF8E5.D4A39510]