SQL Server Performance

TSQL to find all triggers in a database including their count

Discussion in 'Other SQL Server Blogs around the Web' started by Anonymous, Aug 23, 2007.

  1. Anonymous New Member

    For SQL Server 2000 version: SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S2.deltrig = s1.id THEN 'Delete' WHEN S2.instrig = s1.id THEN 'Insert' WHEN S2.updtrig = s1.id THEN 'Update' END 'TriggerType' , 'S1',s1.*,'S2',s2.* FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id] WHERE S1.xtype='TR' For SQL Server 2005 version: SELECT count (*) FROM sys.triggers go SELECT count (*) FROM sys.server_triggers...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2007/08/23/1677.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=1677" width="1" height="1">

Share This Page