SQL Check Constraint Enum
I was trying to enforce something in my database to map to an enum in my domain classes. I knew it was possible to constrain a column to a list of values, because I've had tools such as Visio do it for me. But I could not find the correct syntax. Once I figured it out, I decided to post it here so I can always find it easier next time I forget.
1: ALTER TABLE [dbo].[TableName]
2: ADD CONSTRAINT [TableName_ColumnName_Check]
3: CHECK ([ColumnName] in ('A', 'B', 'C', 'D'))
