View Single Post
  #16  
Old December 5th, 2007, 01:38 PM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Data Primary key vs. Artificial (Autonumber) primary key

On Dec 4, 9:15 pm, "Jeff Boyce" wrote:

Calling all Jeff Boyces...

BlueClaw setup for Employee table

Employee_ID (autonumber, unique index)


Why? By definition, an Autonumber is supposed to already be unique, so


An Autonumber is supposed to auto-generate a value according to an
algorithm; the choices are increment, random or GUID. Show me the
section of the Jet specification which says an Autonumber is supposed
to be unique.

If you like I can post some code to demonstrate the fact that Jet can
auto-generate duplicate Autonumber values (hint: you change increment
value from the default value of one to a value very close to the
maximum for Long Integer).

you
wouldn't gain anything by indexing it.


Can you say "data integrity"? what makes you think that values in an
Autonumber column will be unique unless you put a unique index (or
constraint) on it? Again, I can post code to explicitly insert
duplicate values into an Autonumber column if you like.

Jamie.

--