how to control the values of a field to yes or no

how to control the value of a field so that on ly yes or no can be entered.
kat50Asked:
Who is Participating?
 
Kevin CrossConnect With a Mentor Chief Technology OfficerCommented:
kat50,

Hi.  You could simply make this a bit field or you can use a constraint checking if value of column is IN ('Yes', 'No').  You can get more information on constraints using the BOL.

Hope that helps!
0
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
actually, as "yes/no" field shall be a BIT (0 and 1 values allowed only)
if the field is varchar indeed, the CHECK constraint can do, but note that indeed you will use 2 or 3 bytes to store an information that would use 1 bit (aka 1 byte max if there are not other bit columns) ....
0
All Courses

From novice to tech pro — start learning today.