Trigger Count

  • What is the best way of counting the number of triggers for all the user tables in a specific user database?

    Thanks in advance

    Billy

  • I'd use the XTYPE column in the SYSOBJECTS table, in each database. Like this

    master..sp_msforeachdb [select '?', count(*) from ?..sysobjects where xtype = 'TR']

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Also check for one of my scripts posted some weeks ago. You can see all the triggers, and the state in wich they are. Also you can enable or disable all of them

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply