Re: Updating the SQL key value
- From: gordonb.l29fq@xxxxxxxxxxx (Gordon Burditt)
- Date: Fri, 30 Mar 2007 22:58:06 -0000
I will add a autonumbering PK
Auto-numbered synthetic primary keys are the root of all evil. They usually
indicate a lazy approach to database design. There is almost always a
natural column or combination of columns that can be used as a primary key
without the need to add an extra, redundant numerical column which doesn't
contain any useful information.
Assuming that the you never plan on having two events that occur
concurrently, your "order" column is a perfect natural candidate key.
I disagree, if the nature of that key is such that insertion or deletion
of a record requires re-numbering of other records. I believe the OP wanted
something so that the next upcoming event was *always* numbered 10.
If it's acceptable at some point that the events in the table are numbered
85123, 85127, and 85136, that's fine.
(Though it's a little poorly named, given that ORDER is a SQL keyword.).
- References:
- Updating the SQL key value
- From: bill
- Re: Updating the SQL key value
- From: Erwin Moller
- Re: Updating the SQL key value
- From: bill
- Re: Updating the SQL key value
- From: Toby A Inkster
- Updating the SQL key value
- Prev by Date: Re: Php / Java grids .NET grids
- Next by Date: Re: Yet Another "session_start() Cannot send session cache limiter - headers already sent" Question
- Previous by thread: Re: Updating the SQL key value
- Next by thread: Re: Updating the SQL key value
- Index(es):
Relevant Pages
|