sql语句添加删除外键

--删除外键
alter table AdItem drop constraint AdOrder_AdItem_FK1

--增加外键
alter table AdItem
add constraint AdOrder_AdItem_FK1 foreign key (AI_nOrderNo) references AdOrder(AO_nOrderNo)

--不检查约束
alter table AdItem nocheck constraint AdOrder_AdItem_FK1

--检查约束
alter table AdItem check constraint AdOrder_AdItem_FK1



 

转载于:https://www.cnblogs.com/jiaruistone/archive/2009/10/13/1582567.html

你可能感兴趣的:(sql语句添加删除外键)