级联删除和更新触发器 [英] Cascade on delete and update trigger
本文介绍了级联删除和更新触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我建立了一个接近完成的应用程序。我刚刚意识到我没有将它设置为级联删除和更新记录。我真的不想删除表,甚至数据库只是为了添加这个功能。如何创建一个级联删除和更新记录的触发器?
感谢您的帮助。
Hello
I built an application that is near completion now. I just realized that I did not set it to cascade on delete and update records. I really do not want to drop the tables, or even the database just to add this function. How do I go about creating a trigger that will cascade deletion and update of records?
Thanks for your help.
推荐答案
尝试如何添加ON DELETE CASCADE到一个现有的MySQL表,不丢弃任何现有数据
[ ^ ]。这是针对mySql但基于其他帖子,SQL Server也应该以类似的方式工作。
Try How to add ON DELETE CASCADE to an existing MySQL table without dropping any existing data
[^]. This is for mySql but based on other posts, SQL Server should also work in a similar fashion.
这篇关于级联删除和更新触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文