Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoNumber vs Multi-Field Primary Key

Status
Not open for further replies.

tallbarb

Instructor
Mar 19, 2002
90
US
What are the advantages, disadvantages of using an AutoNumber rather creating a multi-field primary key when there is no obvious field which, by itself, uniquely identifies a record?
 
depends what you want to do.
an auto number is not, in a sense, a primary key since the database itself creates the autonumber by incrementing on a stored variable. because of this, it does not prevent duplication of records. however using a unique identifier within the data that is input you can prevent duplication.

if you are looking to prevent duplication of data use your own primary key or combination primary key

"My God! It's full of stars...
 
Why not use both?

Create a unique index on the multiple fields and use the autonumber as a short reference to that tuple.

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top