Information générale
Titre:
Opinion On Surrogated Key Requested
I am using surrogated keys for some of the transaction tables but couldn't decide whether to use surrogated keys for all the tables with persistent relationship or not. I couldn't see the advantages in some cases. I need some advice.
For example, in invoice table, I can choose to relate to the currency table via a currency code or the surrogated currency key. The currency table has currency description and a recommended exchange rate. Using a currency code, I don't need to refer to the currency table during invoice search because the code itself is meaningful enough. Why would I use surrogated key? One advantage I can think of is to allow my user to ammend the currency code, maybe from 'US$' to 'USD'. Other than that, I can't think of any. Another example is if I want to group the journal transaction. I keep a journal type table for that. It consists of journal type and journal type description. Is it recommended to keep surrogated key for this kind of table?
Can I have some opinions on this? What is the usual practice?
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement