Violates referential integrity

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!
 
K

KARL DEWEY

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top