通过存储过程插入新记录

发布于 2024-09-29 06:45:52 字数 94 浏览 3 评论 0原文

我想使用特定的存储过程插入/更新记录,该存储过程对新记录值执行一些业务逻辑。我可以通过触发器来忽略直接插入的新记录并将新记录值传递到我的存储过程以对传递的值执行适当的操作吗?

I want to insert/update record with a specific stored-procedure which performs some business-logic on new record values. I can do this by trigger to ignore new record from directly to be inserted and pass new record values to my stored-procedure to perform appropriate action for passed values?

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

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

发布评论

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

评论(1

空城旧梦 2024-10-06 06:45:52

一般来说,一旦您在触发器中工作,您需要将所有操作作为触发器主体的一部分执行,而不是调用存储过程等中的其他代码。

这是因为插入和删除的“逻辑表”仅存在于触发器的上下文中。

In general, once you're working within a trigger, you need to perform all of your actions as part of the body of the trigger, rather than calling other code in e.g. a stored proc.

This is because the inserted and deleted "logical tables" only exist within the context of the trigger.

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