A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Do I need a sequential primary key?



 
 
Thread Tools Display Modes
  #1  
Old September 10th, 2009, 04:45 PM posted to microsoft.public.access.tablesdbdesign
Webtechie
external usenet poster
 
Posts: 34
Default Do I need a sequential primary key?

Hello,

I am designing a guest database. Guests leads will be entered into the
Guest Table each day. There should be about 300 leads entered into the guest
table each day.

So I am thinking that I need a primary key.

Scenario #1
========
Table - tblGuest
Primary key = GuestID - autonumber

Now if the guest were ever deleted (no sure why we would need to), it would
mess up my sequential order

GuestID FirstName LastName
1 Tom Jones
2 Susan Smith * deleted
3 Matt Francis

Then I would end up with

GuestID FirstName LastName
1 Tom Jones
3 Matt Francis

So I might need to change my design:

Scenario #2
=======
Table - tblGuest
Primary key = tblGuestID - autonumber
Field to reference = GuestID - number

I would get a max on each transaction and then assign it to my GuestID

tblGuestID GuestID FirstName LastName
1 1 Tom Jones
2 2 Susan Smith * deleted
3 2 Matt Francis (AFTER
GETTING MAX GUESTID)

Question:

Is this a good design? Do I even need to worry about sequential order for a
data entry table? If I just used the autonumber ID, even if a guest gets
deleted that shouldn't throw my referencing the other guests off for
reporting.

I'm leaning toward Scenario #1, but wanted to get the input of those that
know Access table design better than me.

Thanks,

Tony


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.