CHECK CONSTRAINT on multiple columns

后端 未结 3 1079
忘掉有多难
忘掉有多难 2020-11-30 07:36

I use SQL Server 2008

I use a CHECK CONSTRAINT on multiple columns in the same table to try to validate data input.

I receive an error:

3条回答
  •  感情败类
    2020-11-30 08:20

    Check constraints can refer to a single column or to the whole record.

    Use this syntax for record-level constraints:

    ALTER TABLE MyTable
    ADD CONSTRAINT MyCheck
    CHECK (...your check expression...)
    

提交回复
热议问题