Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lookup Tables
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Titre:
Lookup Tables
Divers
Thread ID:
00582278
Message ID:
00582278
Vues:
47
I would really like to hear comments and impressions on a pretty basic design concept. I am designing a new database, with many lookup lists. I want to combine them into one table, so I was going to have a structure something like the following:

idLookup (uniqueidentifier)
cLookupID (varchar(6))
cCode (varchar(6))
cDescription (varchar(40))


So, data might look like this:
cLookupID -- cCode -- cDescription
"State" -- "NY" -- "New York"
"State" -- "NJ" -- "New Jersey"
"Gender" -- "M" -- "Male"
"Gender" -- "F" -- "Female"
"Site" -- "A17" -- "311 West 17th Street"
"Site" -- "C56" -- "23 East 15th Street"

... etc.

I generally like combining lookup tables like this, rather than having separate ones. BUT, what if my "site" codes are not A17 and C56, but actually numeric values -- 17, 56? Do I change the cCode to a Variant and CAST everywhere? Or do I force "17" to be the accepted value rather than 17?

Or do I have three separate lookup tables?

Thoughts?

On a related note, although I keep a row GUID for each of the lookup values, I am considering breaking with database convention and storing the CODE, and not the GUID, in the source table. Or am I asking for trouble?

-- Vin
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform