本节主要内容:
掌握查看数据库中所有触发器的方法。
sql语句:
复制代码 代码示例:
--查询数据库中触发器,全部列出
select so2.name as [Table] , so1.name [Trigger],
so1.refdate,
case sc.encrypted
when 0 then sc.text
else 'unreadable'
end --www.jb200.com
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'