好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

SQLServer中Check约束的学习教程

0.什么是Check约束?

CHECK约束指在表的列中增加额外的限制条件。

注: CHECK约束不能在VIEW中定义。CHECK约束只能定义的列必须包含在所指定的表中。CHECK约束不能包含子查询。

创建表时定义CHECK约束

1.1 语法:

CREATE TABLE table_name
(
  column1 datatype null/not null,
  column2 datatype null/not null,
  ...
  CONSTRAINT constraint_name CHECK (column_name condition) [DISABLE]
);
 

查看更多关于SQLServer中Check约束的学习教程的详细内容...

  阅读:60次