简体   繁体   中英

How can I see the list of all the triggers defined on a Db?

For MS Sql, how can I see the list of all the triggers defined on a Db?

(The reason I need this is one of the columns in one db table seems to be modified by some trigger(s) )

Thanks!

In MSSql:

select B.Name as TableName,A.name as TriggerName
from sysobjects A,sysobjects B
where A.xtype='TR'
AND A.parent_obj = B.id

from http://weblogs.sqlteam.com/davidm/archive/2004/02/27/999.aspx

SELECT trigger_name = name, trigger_owner = USER_NAME(uid), table_name = OBJECT_NAME(parent_obj), isupdate = OBJECTPROPERTY( id, 'ExecIsUpdateTrigger'), isdelete = OBJECTPROPERTY( id, 'ExecIsDeleteTrigger'), isinsert = OBJECTPROPERTY( id, 'ExecIsInsertTrigger'), isafter = OBJECTPROPERTY( id, 'ExecIsAfterTrigger'), isinsteadof = OBJECTPROPERTY( id, 'ExecIsInsteadOfTrigger'), status = CASE OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') WHEN 1 THEN 'Disabled' ELSE 'Enabled' END FROM sysobjects WHERE type = 'TR'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM