Oracle数据库表建立字段唯一性的方法

向已有表中添加惟一性
ALTER  TABLE    表名 ADD  CONSTRAINT 列的约束名 UNIQUE(添加惟一性的字段名)

注:约束名自定

向已有表中删除惟一性
alter table student drop constraint 列的约束名

注:约束名可用sp_helpconstraint student查询


select * from user_constraints ;
这样可以查出所有的用户表的约束 你可以通过where条件指定你的那个约束  找出表

猜你喜欢

转载自panshaobinsb.iteye.com/blog/1772716
今日推荐