Re: Separate PK in Jxn Tbl?

From: Larry Daugherty <Larry.NoSpam.Daugherty_at_verizon.net>
Date: Thu, 24 Jan 2008 17:04:51 -0800
Message-ID: <urlnw2uXIHA.5448_at_TK2MSFTNGP04.phx.gbl>


This boil up is a variation of the "Autonumber vs. Natural Key" religious wars that sweep the Access groups on even numbered(?) years. In the meantime OP is probably trying to hide the matches with which he started the fires....

Until this thread, I thought that I might be the only person in the world who reflexively entered an Autonumber PK into *every* table I design. My reasons for using Autonumber PKs is practical and based on experience.

As for using them in junction tables, I once stopped and thought about it. I couldn't see a risk in either using them or not using them. Since Autonumber PKs had saved me countless hours of re-work in normal tables, my bias was and is to use them. I don't revisit that decision every time I create a junction table, I just do it. Apparently, Tony Toews went through similar reasoning. I didn't ask anyone's advice or permission. It is not necessary that anyone else be persuaded to use any method I adopt.

It has never caused me the least problem. There has been no revelation in this thread that would cause me to even revisit the decision.

In the one reported instance of a "problem", the Autonumber PK along with the two FKs wasn't the issue. That configuration simply spewed different erroneous data from the erroneous data that would be spewed by sticking with natural keys alone. As reported, the problem in that case was erroneous data entry not a flawed schema.

My advice to OP and to everyone else is to use which ever mode seems best to him or her.

HTH

-- 
-Larry-
--

"Phil Stanton" <phil_at_stantonfamily.co.uk> wrote in message
news:13pclc9bkkveq4e_at_corp.supernews.com...

> I always use just the 2 primary keys but....
> If I were a library lending 2 undiffentiatable copies of 1 book to
the same
> person, I suppose I would need an Autonumber PK plus A BookID and
> BorrowerID.
>
> Phil
>
> "Neil" <nospam_at_nospam.net> wrote in message
> news:6kslj.128$J41.113_at_newssvr14.news.prodigy.net...
> > Whenever I've created junction tables in the past, I always made
the PK of
> > the junction table the combined pks from the two other tables. Ex:
Table1
> > PK=A; Table2 PK=B; Junction table consists of two fields, A and B,
which
> > together comprise the PK for the junction table.
> >
> > However, I just came across some code in which the person created
a
> > junction table with a separate PK consisting of an autonumber
field, and
> > then the two fields.
> >
> > So I was wondering how others did junction tables -- with a
standalone
> > autonumber PK, or with a PK consisting of the PKs of the tables
being
> > joined? And, if a standalone PK, then why?
> >
> > Thanks!
> >
> > Neil
> >
>
>
Received on Fri Jan 25 2008 - 02:04:51 CET

Original text of this message