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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Choosing a primary key

Status
Not open for further replies.

sbayeta

Programmer
Apr 4, 2003
13
0
0
AR
Hi,

I have a table with a field called 'lote' containing unique values like

TM07082004
TT07082004
TN07082004
TM08082004
TT08082004

I'd like to know whether I should use this field as primary key for my table, or create an autonumeric field and use that instead.

What are the drawbacks/advantages of each approach ?

Thanks a lot.

Note that the existing 'lote' field can't be eliminated.
 
If the existing field is the record's unique identifier, then I would use that. It keeps things simple, and I can't imagine any situation where an extra field would be of any benefit.

-----
ALTER world DROP injustice, ADD peace;
 

Philosophically, I disagree with with primary keys holding any significance unless you are *absolutely* certain, beyond the shadow of a doubt that the primary key value will never ever ever ever change.

About the only time I use an "intellignent key" is for state abbreviations, I don't think they're changing any time soon.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top