服务器触发器在 SQL Server 中保存在哪里?
几天前,我正在练习,写了一些像这样的触发器:
create trigger trg_preventionDrop
on all server
for drop_database
as
print 'Can not Drop Database'
rollback tran
go
create trigger trg_preventDeleteTable
on database
for drop_table
as
print 'you can not delete any table'
rollback tran
但问题是我不知道它保存在哪里以及如何删除或编辑它们。
谢谢
A couple of days ago , I was practicing and I wrote some triggers like these :
create trigger trg_preventionDrop
on all server
for drop_database
as
print 'Can not Drop Database'
rollback tran
go
create trigger trg_preventDeleteTable
on database
for drop_table
as
print 'you can not delete any table'
rollback tran
But the problem is I don't know where it has saved and How can I delete or edit those.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
服务器触发器
您可以在此处看到它们
要删除使用此语法
在 Management Studio 中,它们位于“服务器对象”-> 下。 “触发器”节点
数据库触发器
您可以在此处看到它们
要删除使用此语法
在 Management Studio 中,它们位于“数据库”-> 下“yourdb”-> “可编程性”-> “数据库触发器”节点
Server Trigger
You can see them here
To drop use this syntax
In Management Studio they are under the "Server Objects" -> "Triggers" node
Database Trigger
You can see them here
To drop use this syntax
In Management Studio they are under the "Databases" -> "yourdb" -> "Programmability" -> "Database Triggers" node
特定表上的触发器驻留在“DataBase”-> “你的Db”-> “你的桌子”-> Management Studio 中的“触发器”文件夹
也可以通过执行以下 sql 来查找特定表上的触发器:
EXEC sp_helptrigger yourtablename
trigger on a particular table resides in "DataBase" -> "YourDb" -> "YourTable" -> "Trigger" folder in Management Studio
also one can find the trigger on a particular table by execution the following sql:
EXEC sp_helptrigger yourtablename