View Single Post
  #5  
Old January 22nd, 2008, 09:35 PM posted to comp.databases.ms-access,microsoft.public.access,microsoft.public.access.tablesdbdesign,microsoft.public.sqlserver
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Separate PK in Jxn Tbl?

On Tue, 22 Jan 2008 20:26:42 GMT, "Neil" wrote:

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?


I've done both; the separate primary key is (strictly speaking) never
necessary, but it can be handy if the junction table is itself related
one-to-many to an additional table or tables. Access doesn't make multifield
foreign keys all that easy to use (e.g. you can't use them in a combobox
without some messy code).

If I do so, I will always specify a unique (non-primary) Index on the two
parent foreign key fields.

John W. Vinson [MVP]