TSQL DISABLE TRIGGER 的作用域是调用上下文吗?
当作为 TSQL 批处理的一部分发出“DISABLE TRIGGER”时,它的范围是否为批处理的上下文,或者触发器对于任何其他并发查询也可能被禁用?
如果是后者,需要什么样的锁定来确保仅针对发出的查询禁用触发器?
When issueing a "DISABLE TRIGGER" as part of TSQL batch, is it scoped to the context of the batch or perhaps the trigger is disabled as well for any other concurrent query ?
If the later, what kind of locking is required to make sure the trigger is disabled just for the issuing query ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它在全球范围内被禁用。不可能仅针对单个连接禁用它。
您可能可以使用的一种技术是将以下内容添加到触发器中
然后在连接中您想要“禁用”触发器
以“重新启用”它使用
It is disabled globally. It is not possible to disable it just for a single connection.
One technique you might be able to use is to add the following to your trigger
Then in the connection you want to "disable" the trigger for use
To "re-enable" it use