- Report as spam Discussion - Post 17 of 69
- Duplicate records
- True, a system-generated primary key will mean that no two records will ever be exactly the same, but there is nothing to prevent the same customer being entered twice and ending up with two different customer ID's. Sure the records aren't exactly the same, but they really are the same person. Anyone that has been involved in "de-duping" a large table will attest to how much fun tracking this can be.
Another important consideration is how quickly new records must be generated. If you are creating new records quickly, auto-generated is the only way to go. If new record creation is more leisurely, a character field can be used. For example, a product part number might be part of a series and contain some information about the part itself.
At one place I worked the part numbers matched the original catalog numbers. TA17-580 might be an air brake cam for a semi-trailer. The cams were left and right handed. 580 would be the right and 581 would be the matching left. The TA stood for trailer axle. Each value in the part number had some relation to the specification of the part. The part numbers held meaning for the customers, system-generated numbers do not.
Postal codes have meaning in each digit as do Social Security numbers and amateur radio license numbers. Somewhere, these values are the primary key for a record, even though they are not meaningless system generated values.
When designing a database there are no rules as simple as the one you propose. Each relationmust be examined alone, candidate keys identified and then decisions made based on a wide number of factors including performance, maintainability, readability and confidentiality. - Posted: 03/27/2002 @ 06:17 AM (PST)
-
![[image]](http://mowser.com/img?url=http%3A%2F%2Fwww.businessdatasolutions.ca%2Fimages%2Frick8.jpg)
- rick@...
1 - Job Role: Software / Applications Development
- Location: North York, Ontario
- Member since: 11/23/2001
- View Profile | Send Message
Print/View all Posts | Subscribe to this Thread
Read original item: The great primary-key debate
Great debate?Lyndal | 03/22/2002 @ 03:01 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Greate Read, Nothing Beginner about ittandel | 03/23/2002 @ 01:09 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Greate Read, Nothing Beginner about ittandel | 03/23/2002 @ 01:14 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
sequential?bob@... | 03/25/2002 @ 12:09 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Natural primary keysjwallison | 03/26/2002 @ 07:58 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
I've had this argument many a time with seasone...travis@... | 03/27/2002 @ 12:23 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Access/Jet Can Make "Mistakes"mattohare@... | 04/03/2002 @ 02:12 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
use of surrogate keyerik.bronckaers@... | 10/10/2002 @ 08:32 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
You've been luckynyc_guru_sorta | 04/12/2002 @ 12:06 PM (PDT)
Surrogate PKs and Composite PKsbuilder@... | 03/26/2002 @ 12:47 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
This is where you'd relate the tablestravis@... | 03/27/2002 @ 12:20 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Line item table keysrick@... | 03/28/2002 @ 12:04 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Child Table PKsmattohare@... | 04/03/2002 @ 02:39 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
ProdID based on current business ruleswmillett@... | 04/08/2002 @ 01:44 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Bad Idea for Line ItemsM. Shawn Dillon | 07/03/2002 @ 12:20 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Opinion on builder's PK questionKeeBored | 10/09/2002 @ 11:12 PM (PDT)
Duplicate recordsrick@... | 03/27/2002 @ 06:17 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Duplicate Recordsbcbeatty | 03/28/2002 @ 11:32 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Unique Clauseaaron_myers | 10/09/2002 @ 11:00 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Two of the major factors in deciding on a natur...JimGawn | 04/02/2004 @ 01:28 PM (PST)
one problemThomasAnderson | 03/27/2002 @ 08:26 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Reading for comprehension...AdminSparky | 03/28/2002 @ 10:37 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Solutionharkins@... | 04/02/2002 @ 11:45 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2Fspacer.gif)
More Solutionmattohare@... | 04/03/2002 @ 02:49 AM (PST)
Surrogates are unnaturalhjweigel@... | 03/29/2002 @ 09:44 AM (PST)
My concernlnarendra@... | 04/01/2002 @ 03:56 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
It's not a surrogate primary key if the the use...adolf s | 04/02/2002 @ 11:14 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Primary key is not seenrsalcedo | 04/02/2002 @ 11:38 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2Fspacer.gif)
A word of caution re advocating that a surrogat...JimGawn | 04/02/2004 @ 01:59 PM (PST)
Social Security Numbers Not Uniquejeffdi@... | 04/03/2002 @ 11:36 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
SSN Faux Follymattohare@... | 04/05/2002 @ 07:35 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
1st Law of Security: Coincidences ain'tian_ison@... | 05/11/2003 @ 03:34 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
There's even moreK.I.S.S. | 06/26/2002 @ 07:15 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2Fspacer.gif)
Privacy and Data Protection Violationk_edwards | 07/23/2002 @ 08:49 PM (PDT)
The conclusion is just plain wrong!AgeTheGod | 04/04/2002 @ 06:24 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
I have to agree + (part 2)jharden@... | 04/30/2002 @ 03:18 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
I have to agree + (part 1)jharden@... | 04/30/2002 @ 03:20 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
I have to agree + (part 3)jharden@... | 04/30/2002 @ 03:21 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Body of evidence...Tore | 10/10/2002 @ 01:17 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
So give some examples...Tore | 10/10/2002 @ 01:13 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Re: The conclusion is just plain wrong!JimGawn | 04/02/2004 @ 02:09 PM (PST)
Non Primary TablesLee Quinn | 04/04/2002 @ 11:51 PM (PST)
Flat Wronghwwang_2000@... | 04/05/2002 @ 03:35 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Read it againmwp.reid@... | 04/21/2002 @ 12:16 AM (PDT)
No surrogate keyTheGreatWall | 04/10/2002 @ 11:22 AM (PDT)
Builder.com irresponsiblerjplummer | 04/16/2002 @ 02:59 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Rubbishmwp.reid@... | 04/21/2002 @ 12:14 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Rubbish..NOTbyrmol@... | 04/21/2002 @ 05:55 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Thats' one for the booksBunce | 06/16/2002 @ 07:38 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Study this ...jharden@... | 04/30/2002 @ 03:43 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Not set in stonepablopp@... | 12/18/2007 @ 10:39 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
And the soap box is outdated at thatK.I.S.S. | 06/26/2002 @ 08:06 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2Fspacer.gif)
User Interface and PKntcse@... | 04/28/2004 @ 08:02 PM (PDT)
Real world example: Natural key badJasonVeniot | 06/25/2002 @ 10:43 PM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
My rules for keysJoe Celko | 07/10/2002 @ 03:43 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2Fspacer.gif)
An Exceptiondburr@... | 03/21/2008 @ 11:01 AM (PDT)
First, there is already a similar article at omen | 06/27/2002 @ 07:09 AM (PDT)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
More things to consider...jgodse1@... | 07/28/2002 @ 01:30 AM (PDT)
Too dogmaticGilles1 | 07/23/2002 @ 06:47 AM (PDT)
Article is bang on.peter.kurth@... | 10/10/2002 @ 01:48 AM (PDT)
I've learned a great tipsugly@... | 11/06/2002 @ 08:54 PM (PST)
Who cares and why?cradford@... | 01/05/2003 @ 10:05 PM (PST)
Nothing But A Furphyjourneyman2001@... | 01/14/2003 @ 11:25 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Ack!!!journeyman2001@... | 01/14/2003 @ 11:57 AM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2Fspacer.gif)
While I'm here though...journeyman2001@... | 01/14/2003 @ 12:04 PM (PST)
Usefule advice marred by serious misconceptionsJimGawn | 04/02/2004 @ 06:35 PM (PST)![[image]](http://mowser.com/img?url=http%3A%2F%2Ftechrepublic.com.com%2Fi%2Ftr%2FtreeSkipItem.gif)
Database Design and Surrogate Keysfrances.brickhill@... | 07/13/2004 @ 01:13 PM (PDT)
RE: The great primary-key debatedburr@... | 03/21/2008 @ 11:03 AM (PDT)SponsoredWhite Papers, Webcasts, and Downloads
Case Study: GHS Data Management Improving Data Protection and Storage Reliability for Critical Databases Dell EqualLogic TechRepublic Resource Guide: Data Backup and Recovery TechRepublic Enhancing Your IT Environment Using Snapshots Dell EqualLogic

SponsoredWhite Papers, Webcasts, and Downloads
Yankee Group: Software as a Service Dramatically Improves CRM Success Oracle PS Series Groups: Backup and Recovery Overview Dell EqualLogic TechRepublic Resource Guide: Data Backup and Recovery TechRepublic

Browse by tag
- networking
- hardware
- programming
- software
- windows
- linux
- it management
- career
- security
- off-topic
- feedback
- project management





![[image]](http://mowser.com/img?url=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2FAds%2F7074%2F12%2Fhotspot%2Fbnr_col1_geekGift.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2FAds%2F7074%2F12%2Fhotspot%2F248054-112-75.jpg)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2FAds%2F7074%2F12%2Fhotspot%2F246336-75-112.jpg)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2FAds%2F7074%2F12%2Fhotspot%2F208195-112-75.jpg)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2FAds%2F7074%2F12%2Fhotspot%2F246555-112-75.jpg)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2FAds%2F7074%2F12%2Fhotspot%2F199725-112-75.jpg)

