Results 1 to 2 of 2

Thread: Constraint

  1. #1
    Join Date
    Oct 2003

    Unanswered: Constraint

    I have a varchar field in a table.I want to restrict the entries in that field as "yes" or "no" nothing else.No record will be allowed for this field without yes or no.My question is is it possible without using any trigger for the table?I want to do it with the help of a constraint.

  2. #2
    Join Date
    Feb 2004
    I think a check constraint could work for you, for example: create table tab (field1 varchar(3) constraint ck_yesno check (field1 in ('yes', 'no')), field2 int).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts