Sunday, March 11, 2012

Check constraint SQL Server 2005

I want to set up a simple check constraint on a column limiting to values "Yes", "No" and ""

I'm trying to use:

CONSTRAINT IsAccessToItRestricted_ck

check (IsAccessToItRestricted in('Yes,'No','');

but this is not the right syntax........... help!

([ColumnName]='Yes' OR [ColumnName]='No' OR [ColumnName]='')

here's your answer

No comments:

Post a Comment