Restrict varchar() column to specific values?

后端 未结 4 2148
长发绾君心
长发绾君心 2020-12-02 08:13

Is there a way to specify, for example 4 distinct values for a varchar column in MS SQL Server 2008?

For example, I need a column called Frequency (varchar) that onl

4条回答
  •  星月不相逢
    2020-12-02 08:13

    When you are editing a table
    Right Click -> Check Constraints -> Add -> Type something like Frequency IN ('Daily', 'Weekly', 'Monthly', 'Yearly') in expression field and a good constraint name in (Name) field.
    You are done.

提交回复
热议问题