增加约束:
ALTER TABLE table_name ADD CONSTRAINT PRIMARY KEY (col_name1,col_name2,.....) CONSTRAINT constraint_name
删除约束:
alter table tabname drop constraint constraint_name
添加主键约束后,也就是给表增加了一个非空索引。索引名由系统给出
获得某个表的约束名的sql:
select constrname from sysconstraints where tabid=(select tabid from systables where tabname="table_name");
阅读(1266) | 评论(0) | 转发(0) |