Solved

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

Posted on 2011-03-20
2
291 Views
Last Modified: 2012-05-11
how to control the value of a field so that on ly yes or no can be entered.
0
Comment
Question by:kat50
2 Comments
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 250 total points
ID: 35175069
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
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 35175092
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

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question