Click here to Skip to main content
15,912,329 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 4:42
mvePIEBALDconsult1-Aug-14 4:42 
GeneralRe: Database - Use number or character? Pin
Brady Kelly1-Aug-14 4:51
Brady Kelly1-Aug-14 4:51 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 5:01
mvePIEBALDconsult1-Aug-14 5:01 
GeneralRe: Database - Use number or character? Pin
Frank Alviani1-Aug-14 5:19
Frank Alviani1-Aug-14 5:19 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 5:31
mvePIEBALDconsult1-Aug-14 5:31 
AnswerRe: Database - Use number or character? Pin
Brady Kelly1-Aug-14 4:20
Brady Kelly1-Aug-14 4:20 
AnswerRe: Database - Use number or character? Pin
Tim Carmichael1-Aug-14 4:38
Tim Carmichael1-Aug-14 4:38 
AnswerRe: Database - Use number or character? Pin
Marc Clifton1-Aug-14 4:49
mvaMarc Clifton1-Aug-14 4:49 
I prefer to keep state in separate table with an FK in whatever other tables need to reference the record state. So, we're really just dealing with ID's, and then you can put whatever short description, long description, "token" char/value, into the lookup table for the UI and it can be easily changed.

julian@giant wrote:
so that they can easily be turned into an enum at the code end


Yuck. That locks your code with to your data/state. What if some day the user wants a new state, like "Cancelled", "Deleted", "Under Review", whatever? The code should look up all the current possible states from the database!

If you have code that does something specific because of state, put it in a stored procedure if possible on the DB side or a separate DLL for application specific stuff on the client side, unless it's a web page in which case the whole maintenance model is somewhat different.

Marc

GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 5:03
mvePIEBALDconsult1-Aug-14 5:03 
GeneralRe: Database - Use number or character? Pin
Marc Clifton1-Aug-14 5:05
mvaMarc Clifton1-Aug-14 5:05 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 5:29
mvePIEBALDconsult1-Aug-14 5:29 
AnswerRe: Database - Use number or character? Pin
BobJanova1-Aug-14 5:03
BobJanova1-Aug-14 5:03 
AnswerRe: Database - Use number or character? Pin
thatraja1-Aug-14 5:25
professionalthatraja1-Aug-14 5:25 
AnswerRe: Database - Use number or character? Pin
Jeremy Falcon1-Aug-14 5:45
professionalJeremy Falcon1-Aug-14 5:45 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 6:22
mvePIEBALDconsult1-Aug-14 6:22 
GeneralRe: Database - Use number or character? Pin
Jeremy Falcon1-Aug-14 8:19
professionalJeremy Falcon1-Aug-14 8:19 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 8:40
mvePIEBALDconsult1-Aug-14 8:40 
GeneralRe: Database - Use number or character? Pin
Jeremy Falcon1-Aug-14 9:02
professionalJeremy Falcon1-Aug-14 9:02 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 9:18
mvePIEBALDconsult1-Aug-14 9:18 
GeneralRe: Database - Use number or character? Pin
Jeremy Falcon1-Aug-14 10:05
professionalJeremy Falcon1-Aug-14 10:05 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 10:47
mvePIEBALDconsult1-Aug-14 10:47 
GeneralRe: Database - Use number or character? Pin
Jeremy Falcon1-Aug-14 12:06
professionalJeremy Falcon1-Aug-14 12:06 
GeneralRe: Database - Use number or character? Pin
PIEBALDconsult1-Aug-14 12:16
mvePIEBALDconsult1-Aug-14 12:16 
GeneralRe: Database - Use number or character? Pin
Jeremy Falcon1-Aug-14 12:36
professionalJeremy Falcon1-Aug-14 12:36 
AnswerRe: Database - Use number or character? Pin
Wendelius1-Aug-14 5:45
mentorWendelius1-Aug-14 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.