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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql table relationship 1

Status
Not open for further replies.

ski2sun

Technical User
Sep 12, 2001
31
0
0
US
I cannot get 3 tables to related. I just dts'd them from access where they seem to be fine in relationship. I cannot even get a diagram of the 3 tables...I get the following msg.....Can someone explain in very simple english...what should I look for....It doesnt seem right....

'Contacts' table saved successfully
'Calls' table
- Unable to create relationship 'FK_Calls_Contacts'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Calls_Contacts'. The conflict occurred in database ‘Customers', table 'Contacts', column ‘Customer_ID'.
 
Most likely cause of the problem is the existence of a Customer_ID in the Calls table that doesn't exist in the Contacts table.

Try a query like this to see if that is the problem.

Select * from Calls a
Where Not Exists
(Select * From Contacts
Where Customer_ID=a.Customer_ID) Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
thanks...working on your suggestion right now. thanks for making the explanation simple...just what I needed..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top