Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Data Type to Use For True/False/NA

Author  Topic 

Dbar
Starting Member

12 Posts

Posted - 2008-11-12 : 08:13:34
I need to capture one of three values --- true, false, or not applicable (NA). I understand that the BIT data type stores true, false, and null. What type of .NET data control could I use in the user interface to provide selection of all 3 values? Once a checkbox is set to true or false, can it be set back to null? Or should I just use a Char field ("T", "F", "NA")?

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2008-11-12 : 08:41:30
NULL does not mean n/a it means unknown or not specified. I would use T,F or N with NOT NULL if applicable. Put a check constraint on the column to make sure it can store only 3 values (+null if required)
Go to Top of Page

malaytech2008
Yak Posting Veteran

95 Posts

Posted - 2008-11-12 : 09:07:30
What exactly is ur requirement?do you want to store three values differently or together in DB?

malay
Go to Top of Page
   

- Advertisement -