Violates referential integrity

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi all...something is wrong in my DB. I brought home the BE..and all the
realtions were broke. now i have established almost all but for two RI
relations of high importance..When i try to Enforce Referential Integrity i
recive cant create this relationship...how do i do in order to find those
records that causes this problem..

how can i repair this mess....

Thanks a lot!
 
Easy, just run 'Unmatched' query.
Like this using your actual table and field names --
SELECT tblManySide.ForeignKey
FROM tblManySide LEFT JOIN tblOneSide ON tblManySide.ForeignKey =
tblOneSide.PrimaryKey
WHERE tblOneSide.PrimaryKey Is Null
ORDER BY tblManySide.ForeignKey;

Add the foreign key field information from the many side to the one side of
the relationship.
 
Back
Top