Auto generating primary key

  • Thread starter Thread starter AJ Raiber
  • Start date Start date
A

AJ Raiber

Access can create a primary key for you using just a plain
Autonumber field marked as your primary key. If this is a
table using SSN though, you can use that as your primary
key as well since no two socials are the same.
 
AJ Raiber said:
Access can create a primary key for you using just a plain
Autonumber field marked as your primary key. If this is a
table using SSN though, you can use that as your primary
key as well since no two socials are the same.

Could be a problem for a woman who marries and changes her name.
 
Well that is my problem that I just figured out. We deal
with patients that are babies and they do not always have
a SSN for a long while after they are born. I was
thinking maybe still first three intials of their last
name and first three intials of their first name and the
last four digits of their phone number. It is vital that
I get these data fields to link because we have several
patients on different lists of equipment that I want their
name to be together so whenever the users type in the name
of the desired patient they can pull up all the equipment
that the person has out.
 
The issue with something like that is that Michael Smith
whose phone is 555-6224 and Michelle Smithson whose phone
is 526-6224 would return the same string MicSmi6224. If a
baby is the subject and they do not have a SSN then you
could keep you own log of mock SSNs. Use 000 prefixes or
999 prefixes as they are highly uncommon.

You could also just use a "Record Number" as a unique 9
digit code (holding up to 999,999,999 records which is
larger than a single DB will hold most likely) and give
each record that number. It would be relatively simple to
input it into your excel list in the first column. If you
want to do this and need help, then please e-mail me.
Thank you.
 

I came in late on this and don't advocate such a scheme.
However the date of birth and the babies initials will give a very good
Unique ID
It is *very* rare to have an exception and more than 90% of these will be
with twins who have the same DOB and same initials.
This is valid for at least a fair size county birth records.

An initial and first four letters of the last name are also very good over
large sample sizes.

This comes from more than 20 years ago when it was harder and slower to look
things up with names, dates and times of births etc.

Using an artificial SSN sooner or later will cause a problem when somebody
puts the correct one in when it is obtained.
 
Back
Top