如何更改表中的列检查约束

时间:2013-11-11 19:07:36

标签: sql firebird

我有一个专栏Column1 integer check(column1 >=0) not null unique;。现在我想更改列,以便column1的检查值为&lt; = 0。我已经尝试过:alter table table1 alter column column1 type integer check(column1 <=0) not null unique;但它不起作用。有解决方案吗

1 个答案:

答案 0 :(得分:0)

所以当你说你的数据库是什么时,这就是你需要的命令:

alter table table1 add constraint CK_NEGATIVEVALUES check ( column1 <=0 )

您不会更改列以添加更改表的检查以添加CONSTRAINT CHECK