sql语句添加删除外键及其约束


--删除外键

ALTER TABLE t_base_role_module

DROP CONSTRAINT fk_t_base_role_module_t_base_defined_url;

--增加外键

ALTER TABLE t_base_role_module

ADD CONSTRAINT fk_t_base_role_module_t_base_defined_url

FOREIGN KEY (module_id)

REFERENCES t_base_defined_url (module_id)

ON DELETE CASCADE;

--不检查约束
alter table 表 nocheck constraint fk_name

--检查约束
alter table 表 check constraint fk_name


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM