Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / August 2004

Tip: Looking for answers? Try searching our database.

Primary key of two fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ellen - 30 Jul 2004 20:39 GMT
I have a table that has two fields, the combination of
which is unique.  Can I make the combination of two fields
a primary key?

Are there limitations with this?  Both fields are wordy at
places, although the combination is never more than 255
characters.

Thank you in advance,
Ellen
Immanuel Sibero - 30 Jul 2004 22:12 GMT
Hi Ellen,

Yes you can have two fields as a primary key (called composite key).

Limitiations? As far as using composite key as opposed to single field
primary key? Not off the top of my head, nothing major at least. But you
will find quite a good deal of conceptual debate in this newsgroup as to the
the merit of using one vs the other.

From your post, I'm more concerned about the fields that you're about to
designate as primary key (i.e. Both fields are wordy at  places, although
the combination is never more than 255  characters). Primary keys should be
unique, short, probably even meaningless. So, for example a first name, last
name, description,  should not be primary key(s).

HTH,
Immanuel Sibero

> I have a table that has two fields, the combination of
> which is unique.  Can I make the combination of two fields
[quoted text clipped - 6 lines]
> Thank you in advance,
> Ellen
Ellen - 02 Aug 2004 13:22 GMT
Thanks, Immanuel.  I think I'll give the records an
arbitrary number.  There used to be a field you could
designate as an autonumber.  I know that still exists,
don't know if they still call it an autonumber, though.  
Also generally, the simpler the better.
>-----Original Message-----
>Hi Ellen,
[quoted text clipped - 27 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.