View Single Post
  #16  
Old January 23rd, 2008, 05:01 PM posted to comp.databases.ms-access, comp.databases.theory,microsoft.public.access, microsoft.public.access.tablesdbdesign,microsoft.public.sqlserver
Dustin W. Jones
external usenet poster
 
Posts: 2
Default Separate PK in Jxn Tbl?

On Jan 22, 3:26 pm, "Neil" wrote:
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


I've done both. I try to use natural keys where applicable, usually
both PK's as the primary for the junction table.