Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing PK column type
Message
De
15/01/2016 12:31:12
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/01/2016 11:58:22
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01629774
Message ID:
01629824
Vues:
64
>Just as having int be the PK type everywhere as a standard is a good thing, so is having meaningless keys as a standard. The point to them is to prevent any kind of cascade updates. You have an invoice number on the invoice header. You have a meaningless key on the invoice header. You use that key to join to line items. The invoice number can be changed all you want with no effect on the line items.

Wrong example - any accountant or auditor will frown at changing an invoice number - but the logic here is correct. For instance, one would be insane to make a house number part of any important key, as streets may undergo renumbering. Or the passport number example - it is maybe a good PK for the passport, but not for a person, as passports expire. Etc etc. An invisible PK is not changing ever, simply because it's not doing any sidejob, it's just a key.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform