How do I put a constraint on a column so that it can only contain the following values? What do you call this type of constraint?
Allowed values: "yes", "no" or "maybe"
Column Data Type: nvarchar(5)
DBMS: SQL Server 2008
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can use a CHECK constraint
MSDN link