In MySQL there is a data type called ENUM that allows you to store a lost of
preset values like so:

CREATE TABLE sizes (
    name ENUM('small', 'medium', 'large')
);

Unfortunately there is no equivalent to ENUM in MSSQL.  However it is
possible to emulate the same functionality using a constraint.

http://www.stev.org/post/2011/05/26/MSSQL-Enum.aspx

HTH,
G!


On Thu, Oct 20, 2011 at 1:23 PM, John M Bliss <[email protected]> wrote:

>
> I think the clearest method is probably selects with options:
>
> value - display
> NULL - not set (or similar)
> 1 - true/yes/on
> 0 - false/no/off
>
> On Thu, Oct 20, 2011 at 12:06 PM, Carl Von Stetten
> <[email protected]>wrote:
>
> >
> > I'm rewriting a CF application that stores its data in SQL Server (2005,
> > moving to 2008R2 soon).  I have a number of bit datatype columns in my
> > tables, which correspond to true/false or yes/no values in the
> application.
> >  For some of these values, I need to track if they have not yet been set
> to
> > either true or false.  On the database side, I can allow the columns to
> > contain nulls (and apply a default constraint set to null), so the value
> in
> > the column could be null, 0 or 1.
> >
> > On the application UI side, bit values are typically represented by
> > checkboxes.  It seems to me that checkboxes can only clearly communicate
> two
> > states.  I could use a set of radio buttons, and have neither radio
> button
> > on by default (which would represent null values in the database).  Is
> this
> > the best way, or are there alternatives?
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348281
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to