Many to Many Data Integrity (Alway confuse myself)

D

DeDBlanK

OK, thanks in advance. I always screw this up so here it goes:

Three tables: Line, Part, LinetoPart
I could set these tables up differently, but Part A can be ran on
Line1, 2, or 3.
LinetoParts has autonumber pkLinetoPart, fkLine, and fkPart.
So how do I keep the many table from duplicating say an entry stating
that Part A to Line 1? Am I missing the boat here?
In the LinetoParts pkParts can duplicate and pkLine can duplicate, but
I don't want a duplicate record with the same pkPart and pkLine.
*Relationship Algebra why do you plague me so?*
 
F

Fred

At the nuts and bolts level, what you seek is a constraint on records in
your junction table, not on the relationships.

How about creating a 2 field (fkLine, fkPart) index in your junciton table
set to "unique"?
 

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