如何删除表sql中的外键约束 [英] how do delete foreign key constraints in table sql
本文介绍了如何删除表sql中的外键约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Cannot truncate table 'tbl_branchmaster' because it is being referenced by a FOREIGN KEY constraint.
推荐答案
检查一下:
http://www.w3schools.com/sql/sql_foreignkey.asp [ ^ ]
ALTER TABLE table_name1
--DROP CONSTRAINT fk_columnnname
--GO
- 截断表table_name
--GO
ALTER TABLE table_name1
--DROP CONSTRAINT fk_columnnname
--GO
--truncate table table_name
--GO
这篇关于如何删除表sql中的外键约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文