如何在SQL Server中删除触发器?
我需要删除 SQL Server 中的触发器。看起来应该很简单,但是因为有一种称为“删除触发器”的东西,即在删除时调用的触发器,所以似乎不可能找到有关如何实际删除已存在的触发器的资源。
I need to delete a trigger in SQL Server. Seems like it should be simple enough, but because there is a thing called a "delete trigger", a trigger that is invoked upon deletion, it seems impossible to find resources on how to actually delete an already existing trigger.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
删除触发器:
DROP TRIGGER:
要删除触发器,可以这样做:
如果您想在删除之前检查天气触发器是否存在,请使用:
有关更多信息,请查看 http://www.tsql.info/triggers/drop-trigger.php 和 https: //stackoverflow.com/a/636470/2218697
To drop a trigger, this works:
If you want to check weather trigger exist before a drop, then use:
For more check out http://www.tsql.info/triggers/drop-trigger.php and https://stackoverflow.com/a/636470/2218697
对于 SQL Server 2016 及更高版本
https: //learn.microsoft.com/en-us/sql/t-sql/statements/drop-trigger-transact-sql
For SQL Server 2016 and above
https://learn.microsoft.com/en-us/sql/t-sql/statements/drop-trigger-transact-sql
我可以使用以下查询删除触发器
希望这一定有帮助......
I can Drop a Trigger with the Following Query
Hope this Must helpfull...