What if a trigger fails?

狂风中的少年 提交于 2019-12-23 08:50:22

问题


If I run an insert query, but I have a trigger on a table to increment another value based upon the trigger, but there's something wrong with the trigger, will it still execute my query?


回答1:


The following reference article should help. Basically, an error during either a BEFORE or AFTER trigger results in failure of the entire statement that caused trigger invocation.

You shouldn't need to test this out, but if you wanted to quickly test this out, simple create a dummy table with a failed insert trigger. The results would be very clear from there.

Hope I helped



来源:https://stackoverflow.com/questions/4249269/what-if-a-trigger-fails

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!