List:General Discussion« Previous MessageNext Message »
From:Rudy Lippan Date:December 21 2005 10:15pm
Subject:Re: Reason for Auto-increment primary keys?
View as plain text  

>
> If this trend is real, it doesn't seem like a very good trend to me. For 
> example, if you were keeping track of parts in a warehouse, why would anyone 
> make a table that looked like this:
> ID (autogenerated PK)     PART_NO    PART_DESCRIPTION
> 1                                   A01             Widget
> 2                                    B03            Grapple Grommet
> 3                                    A02            Snow Shovel
> 4                                    D11            Whisk
> 5                                    C04            Duct Tape
>
> when this table is simpler:
>
> PART_NO (PK)   PART_DESCRIPTION
> A01                 Widget
> B03                Grapple Grommet
> A02                Snow Shovel
> D11                Whisk
> C04                Duct Tape
>
> Would anyone care to convince me that the first version of the table is 
> "better" than the second version in some way?
>


I can go either way on this. I like the PART_NO as the pri key better, but I 
will quite often use the autogenerated pk to make my life easier. How?

Take for instance when you get "the email":


Hey Rhino,

I have a spec change for the warehouse application you are working on. Can you 
plese modify the application so that "Widget" and "SuperWidget II plus" can have 
the same part number. I know it sounds weird, but the guys upstairs want it. I 
have tried to talk them out of it, but legal insists, and I can't do anything 
about it at this point, sorry.

Oh, and we need this to QA by EOD Monday. Work as may hours as you need over
the weekend to make this happen.

thanks,

Joe.

Joe Blow
Sr. Project Manager
Thingey, inc.

------------------


It is much easier to make these sorts of changes if your pk is something that 
you have control over rather than an soemthing that is defined by someone else 
because they will change the definition on you mid-way though the project.


Rudolf.
Thread
Reason for Auto-increment primary keys?Rhino21 Dec
  • Re: Reason for Auto-increment primary keys?Kenneth Wagner21 Dec
    • Re: Reason for Auto-increment primary keys?SGreen21 Dec
      • Re: Reason for Auto-increment primary keys?Rhino21 Dec
        • Re: Reason for Auto-increment primary keys?SGreen22 Dec
      • Re: Reason for Auto-increment primary keys?Kenneth Wagner22 Dec
        • Re: Reason for Auto-increment primary keys?David Griffiths22 Dec
        • Are primary keys essential?James Harvard22 Dec
      • Re: Are primary keys essential?Kenneth Wagner22 Dec
        • Re: Are primary keys essential?James Harvard22 Dec
          • Re: Are primary keys essential?James Harvard22 Dec
      • Re: Are primary keys essential?Kenneth Wagner22 Dec
      • Re: Are primary keys essential?Rhino22 Dec
      • Reporting tools for summary dataC.R.Vegelin22 Dec
        • Re: Reporting tools for summary dataJames Harvard22 Dec
    • Re: Reason for Auto-increment primary keys?Josh Trutwin21 Dec
  • Re: Reason for Auto-increment primary keys?Peter Brawley21 Dec
    • Re: Reason for Auto-increment primary keys?James Harvard22 Dec
  • Re: Reason for Auto-increment primary keys?Rudy Lippan21 Dec
RE: Are primary keys essential?SST - Adelaide)22 Dec