View Single Post
  #2  
Old November 20th, 2008, 03:39 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Numberic Field for Lookup

For tables where there is a simple, obvious, short, natural primary key, use
it.

For example, if you have a table of categories where each category name is
unique, required, and say 24 characters or less, it makes good sense to use
the category name as the primary key IMHO. IME, there is no practical
difference in performance when using a text-key for these little tables with
1000 records.

Some developers avoid this because they have generic routines that assume a
particular data type. You do have to remember to add the quote delimters
when matching a value in a text field.

Sometimes the text primary key is really handy, e.g. it avoids some problems
Access has when a combo's bound column is not the display problem:
http://allenbrowne.com/bug-06.html

So, I'm not convinced it would be worth the effort to change them all.

If you do have problems in remembering the data types and sizes for all the
fields in your projects, here's what I use:
Relationship Report with extended field information
at:
http://allenbrowne.com/AppRelReport.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Rita" wrote in message
...
I designed a huge database 10 years ago. I finally am going back and
cleaning
things up. There are several tables that I used a text field as a primary
field. I would like to delete the relationships, create an autonumber
field
for each table, and recreate the relationships. I have 147 queries though
so
it would be a lot of work. Everything works, so would the database run
better
using a numberic field? Thanks!