February 22, 2011 at 11:36 pm
I have a column name status in mytable. It should have either true or false
as a data.
for storing true or false value which data types is preferable...
February 23, 2011 at 5:40 am
personally i use an integer with a check constraint limiting values to 0 and 1;you could use a BIT data type,but I like an integer to anticipate those situations where the flag starts turning into a status..
For example a (SHIPPEDFLAG) columns needs to change, so instead of TRUE/FALSE, suddenly needs 'tween statuses like RECEIVED/INVOICED/PROCESSING/PACKAGED/SHIPPED, and in that case it makes it a little easier to support the switch...just changing the constraint, or making it suddenly reference a new table with matching values for the foreign keys.
Lowell
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply