Limit Data by Index

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have a 2 tables One that contains the Orders and then one that the order
detail.

Tbl1
* OrderID Index with No Dups

Tbl2
* OrderDetID Index with No Dups
* OrderID Index with Dups --->> Linked to Tbl1 in the relationships
* LineNum Index with Dups
Items

* Primary Key

I am importing this data from an external source and Its allowing me to
upload multiple items in Tbl2. I was hoping by making the OrderDetID, OrderID
and LineNum as Primary that it would not allow duplicates. However that is
not the case. It is allowing mutliple entries of the same details.

I have to make an upload of this data mutliple times during the day and need
and would like it to not upload the data if it finds it already in the table.

Any suggestions on this issues?

Thanks
Matt
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your Primay Key (PK) for the OrderDetails table should be the OrderID
and the LineNum columns. If you inclue the OrderDetID column in the PK
it (the PK) will always be different 'cuz the OrderDetID is Unique (no
dups). You have to limit the LineNum to just the those rows (records)
that have the same OrderID. You do that by using just the OrderID and
the LineNum columns in the PK. IOW, the PK could be translated as "This
OrderID has these LineNumbers."
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRJC2LIechKqOuFEgEQJN4ACeIhg4KuPQTYQFejnPxd4apu5R87gAoM+l
zBirEOStTKpk1V8avbDFclDA
=KLig
-----END PGP SIGNATURE-----
 

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