问题描述
我创建了表A
和表B
Msg 3726,Level 16,State 1,Line 4 Could not drop object 'a' because it is referenced by a FOREIGN KEY constraint. Msg 3726,Line 5 Could not drop object 'b' because it is referenced by a FOREIGN KEY constraint.
CREATE TABLE a (
no INT IDENTITY(0,1) NOT NULL,aaa NVARCHAR(4000) NOT NULL,);
CREATE TABLE b(
no INT IDENTITY(0,bbb NVARCHAR(4000) NOT NULL,);
这些是我对这些表的参考约束
ALTER TABLE a ADD FOREIGN KEY (no) REFERENCES b(no);
ALTER TABLE b ADD FOREIGN KEY (no) a(no);
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE a;
DROP TABLE b;
SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE ENERGY.D_CORROSION_COUNT_1 CASCADE CONSTRAINTS PURGE;
DROP TABLE ENERGY.D_CORROSION_COUNT_2 CASCADE CONSTRAINTS PURGE;
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)