SQL Server 数据库技术之:Get Triggers for the Table
作者:本站原创转载自:xin3721网络学院更新时间:2010/10/19

Get Triggers for the Table
By: mohit108 
Use this script to get Insert, Update and Delete trigger for all the tables. This script will give you just the first level of triggers. So if you have more than 1 insert trigger, it will give you the first one.

Mohit Nayyar
MCP (.Net), MCSD, MCDBA 

select a.name 'Table', i.name 'Insert Trigger', u.name 'Update Trigger', d.name 'Delete Trigger'
from sysObjects a,  sysObjects i, sysObjects u, sysObjects d
where ((a.deltrig>0 or a.instrig>0 or a.updtrig>0) and a.type != 'TR')
and a.instrig *= i.id and a.updtrig *= u.id and a.deltrig *= d.id

--Use the next line for specific table check
-- and a.name = 'TableName'


关于我们--广告服务--免责声明--本站帮助-友情链接--版权声明--联系我们     黑ICP备07002182号