当前位置: 数据库>sqlserver
查看数据库中所有触发器的sql语句
来源: 互联网 发布时间:2014-08-29
本文导语: 本节主要内容: 掌握查看数据库中所有触发器的方法。 sql语句: 代码示例: --查询数据库中触发器,全部列出 select so2.name as [Table] , so1.name [Trigger], so1.refdate, case sc.encrypted when 0 then sc.text else 'unreadable' end --www. as Defina...
本节主要内容:
掌握查看数据库中所有触发器的方法。
sql语句:
代码示例:
--查询数据库中触发器,全部列出
select so2.name as [Table] , so1.name [Trigger],
so1.refdate,
case sc.encrypted
when 0 then sc.text
else 'unreadable'
end --www.
as Defination
from syscomments sc inner join sysobjects so1 on sc.id= so1.id
inner join sysobjects so2 on so1.parent_obj = so2.id
where so1.xtype='TR' and so2.xtype='U'
select so2.name as [Table] , so1.name [Trigger],
so1.refdate,
case sc.encrypted
when 0 then sc.text
else 'unreadable'
end --www.
as Defination
from syscomments sc inner join sysobjects so1 on sc.id= so1.id
inner join sysobjects so2 on so1.parent_obj = so2.id
where so1.xtype='TR' and so2.xtype='U'