Monday, September 24, 2007

SQL Server @ Query To List Available Triggers On a DataBase

The following query is helpful to enlist all the available triggers on a specific database. sys.triggers is a view that contains a row for each object that is a trigger.

Here is the query:

USE MSDB -- Database Name Here
SELECT name,type,type_desc,create_date,modify_date
FROM sys.triggers


Results:
---------------------------------------------------------
name type type_desc create_date modify_date

trig_sysmail_profile_delete TR SQL_TRIGGER 2005-10-14 01:55:32.520 2005-10-14 02:02:31.787
trig_sysmail_servertype TR SQL_TRIGGER 2005-10-14 01:55:32.740 2005-10-14 02:02:31.850
trig_sysmail_server TR SQL_TRIGGER 2005-10-14 01:55:33.067 2005-10-14 02:02:31.910
trig_sysmail_configuration TR SQL_TRIGGER 2005-10-14 01:55:33.287 2005-10-14 02:02:31.943
trig_sysmail_mailitems TR SQL_TRIGGER 2005-10-14 01:55:33.507 2005-10-14 02:02:31.990
trig_backupset_delete TR SQL_TRIGGER 2005-10-14 01:55:16.113 2005-10-14 02:02:32.007
trig_sysmail_attachments TR SQL_TRIGGER 2005-10-14 01:55:33.723 2005-10-14 02:02:32.050
trig_sysmail_log TR SQL_TRIGGER 2005-10-14 01:55:33.943 2005-10-14 02:02:32.100
trig_sysoriginatingservers_delete TR SQL_TRIGGER 2005-10-14 01:54:09.833 2005-10-14 02:02:32.397
trig_sysjobs_insert_update TR SQL_TRIGGER 2005-10-14 01:54:10.490 2005-10-14 02:02:32.520
trig_sysschedules_insert_update TR SQL_TRIGGER 2005-10-14 01:54:12.677 2005-10-14 02:02:33.210
trig_targetserver_insert TR SQL_TRIGGER 2005-10-14 01:55:08.570 2005-10-14 02:02:34.740
trig_notification_ins_or_upd TR SQL_TRIGGER 2005-10-14 01:55:14.583 2005-10-14 02:02:35.333
trig_notification_delete TR SQL_TRIGGER 2005-10-14 01:55:14.910 2005-10-14 02:02:35.363
trig_sysmail_profile TR SQL_TRIGGER 2005-10-14 01:55:31.647 2005-10-14 02:02:35.787
trig_principalprofile TR SQL_TRIGGER 2005-10-14 01:55:31.867 2005-10-14 02:02:35.833
trig_sysmail_account TR SQL_TRIGGER 2005-10-14 01:55:32.083 2005-10-14 02:02:35.863
trig_sysmail_profileaccount TR SQL_TRIGGER 2005-10-14 01:55:32.303 2005-10-14 02:02:35.910

No comments: