[求助]怎样取消的一个属性的的唯一性约束条件
请问各位大侠在sql中是怎样取消一个属性的的唯一性约束条件的.如:
create table test
(
name char(10) unique);
创建表后怎么才能取消这个唯一性约束啊.
我还不知道约束名呢?
所以最好这样建表
create table test(name char(10) constraint uq_test unique)
然后删除就可以了:
alter table test drop uq_test
另外,如果是在现有列上添加约束可以这样(比如添加一个check约束)
alter table test with nocheck add check (name>22)/*其中with nocheck表示在添加约束时,要对表中的数据与约束不进行检查,其默认为with check表示要进行检查*/
谢谢ninggang.