- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Whilst still not guaranteed to be unique (so still satisfying the requirement of being "Good Enough, so will still mysteriously fail sometimes), what's wrong with this
Addendum 2019-10-31 03:20: Yes, I'm also aware that this method is slightly biased towards lower numbers as there uint.MaxValue is not exactly divisible by 99999, but we're talking "Good Enough" here
Addendum 2019-10-31 03:28: Oops, I also realised it should have been 6 random numbers. Bad Code Monkey!
Admin
Rick, I know that the Wikipedia article says VINs have a standard, but that's a standard that manufacturers follow. In the case of a home-built vehicle, I'm the manufacturer and I'm the one creating the VIN. The DMV doesn't tell me to follow the standard and doesn't care if I do.
Admin
You said "proper mix of natural keys and surrogate keys" so in some cases a natural key is better than a surrogate key. Can you name one example where that holds true?
Admin
"Many years ago, a researcher created a database using patient's medical record numbers as primary keys, which is a good natural key. "
That's not a natural key, it's a surrogate key. An example of a natural key would be the patient's name.