Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Foreign Keys

Status
Not open for further replies.

AEtherson

Programmer
Oct 10, 2003
119
GB

I'm a newbie to SQL Server. I'm trying to create a database where multiple fields in a table can point to one field in a second table. I create a foreign key from Field1 in Table1 to Field1 in Table2. I then try to create a Foreign Key from Field2 in Table1 to Field1 in Table2. It won't let me do this as the Foreign Key has the same name. Any ideas?

Table 1 Table 2
Field1 Field1
Field2 Field2
Field3 Field3
Field4 Field4
Field5 Field5
Field6 Field6
Field7 Field7
Field8 Field8
Field9 Field9

 
give the foreign key a different name. thats what it is complaining about if I understood correctly your problem.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top