Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个专栏Column1 integer check(column1 >=0) not null unique;。现在我想更改列,以便 column1 具有 <=0 的检查值。我已经尝试过:alter table table1 alter column column1 type integer check(column1 <=0) not null unique;但它不起作用。有什么解决办法吗?
Column1 integer check(column1 >=0) not null unique;
alter table table1 alter column column1 type integer check(column1 <=0) not null unique;
因此,正如您所说,您的数据库是什么,这是您需要的命令:
alter table table1 add constraint CK_NEGATIVEVALUES check ( column1 <=0 )
您不更改列以添加检查您更改表以添加CONSTRAINT CHECK
CONSTRAINT CHECK