Click to See Complete Forum and Search --> : Foreign Key Help


invisible777
04-15-2007, 07:51 PM
New to SQL... using SQL Server 2005.

I have two tables I want to create. One is Customer, one is Salesperson. Both have a foreign key dependent on the opposite table.

When I try to create each table I get an error saying "Foreign Key references invalid table". Since each table requires the other one to be created before you can create that table (customer wants salesperson first, salesperson wants customer first) how do I begin the process of creating these tables? I think once the first one is up, then the ball is rolling, right?

Thanks!

cs3mw
04-17-2007, 09:11 AM
What you are doing is creating a many to many relationship which a relational database can not handle!! what you want to do is correctly normalise your tables in this case meaning creating another table. Post your table contents and a brief description of what the table is and il have a look for you.