Selecting Surrogate keys is the simpleset decision, no need to think just add a column and set it identity or add a sequence may think a bit more and add rowid or Guid.
But there are cases, that Natural keys are better than Surrogate keys.It is where a good Natural key exists, like when a good code is introduced by the business logic or by a standard like ISO standard. I don't think a surrogate key can be better than ISO country code when you have a Country table, same Currency codes like IRR,SEK and USD are much better than 0,1 and 2. They are better for maintenance, exporting and importing. to be used as foreign key.
I saw many errors, when a programmer joined to tables by wrong pk/fk s and as both keys where numbers, for long time no one could find the problem, but what about this join
.
.
.
Currencies
inner join CurrencyRates on Currencies.Code = CurrencyRates.CurrencyRateID
the error shows up immediately.
I realy have found, many problems in such a n implementation that could be solved using its natural key.
Discussion on:
Keep Up with TechRepublic
Media Gallery
View All
Hot Discussions
Vendor Showcase
View All
Hot Questions
White Papers, Webcasts, and Downloads
-
White PapersGet Ongoing Benefits from Server Virtualization
Take a look at the priority list for any small or mid-size business, and chances are you'll see "virtualization" at the top. And with good reason. Read this white paper to learn how to get the most value out of server virtualization.
From VMware -
White Papers
Get Ongoing Benefits from Server Virtualization
From VMware -
Webcasts
Live Webcast: 3 Simple Steps to Better Patch Security
From Sophos -
White Papers
Strategies for Deploying Blade Servers in Existing Data Centers



































