如果触发器失败怎么办?

发布于 2024-10-04 00:23:41 字数 61 浏览 1 评论 0原文

如果我运行插入查询,但表上有一个触发器,可以根据触发器增加另一个值,但触发器有问题,它是否仍会执行我的查询?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倒数 2024-10-11 00:23:41

以下参考文章应该有所帮助。基本上,BEFORE 或 AFTER 触发器期间的错误会导致导致触发器调用的整个语句失败。

您不需要测试这一点,但如果您想快速测试这一点,只需创建一个插入触发器失败的虚拟表即可。从那里结果将非常清楚。

希望我有帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文