|
|
|
|
|
by SigmundA
106 days ago
|
|
How do you store them? Also enums are not user configurable normally. It would be a good feature to have them, but they don't work well in many cases. Typical code tables with code, description and anything else needed for that value which the user can configure in the app. Sure you can use integers instead of codes, now all your results look like 1, 2, 3, 4 for all your coded columns when trying to debug or write ad-hoc stuff. Also ints are not variable length so your wasting space for short codes and you have to know ahead time if its only going to be 1,2,4 or 8 bytes. |
|
For configurable values, obviously you use a table. But those should have an auto-integer primary key and if you need the description, join for it.
Ints are by far more the efficient way to store and query these values -- the length of the string is stored as an int and variable length values really complicate storage and access. If you think strings save space or time that is not right.