Tables - Referential Integrity

shamas21

Registered User.
Local time
Today, 19:40
Joined
May 27, 2008
Messages
162
Hi All

I have two atbles - both have a column called CustomerID.

Im trying to enforce Referential Integrity between the two but it wont let me.

1) Can someone explain the benefit of this

2) Why doesnt it allow it - message says (Data voilates Referential Integrity rules, there may be records for the employee in the related table but not in the primary table).

Thanks
 
Because you inserted data into the "slave" table without having a matching record in the "master" table. You must have all the data in the FK of the slave table represented within the master table before creating the relationship.
 
Ok thats great. It works now.
 

Users who are viewing this thread

Back
Top Bottom