How can I get a list of all the triggers associated with a particular
table in a database. And in addition, how can I get a list of all
triggers for the entire database (meaning all triggers associated with
all tables)? Thanks!!
Regards,
Troy
Troy,
[vbcol=seagreen]
answered my own question... here's the query in case someone else is
wondering:
SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S1.deltrig
> 0 THEN 'Delete' WHEN S1.instrig > 0 THEN 'Insert' WHEN S1.updtrig > 0
THEN 'Update' END 'TriggerType' FROM sysobjects S1 JOIN sysobjects S2 ON
S1.parent_obj = S2.[id] WHERE S1.xtype='TR'
Regards,
Troy
Monday, February 20, 2012
List all triggers for a table or an entire database
Labels:
addition,
alltriggers,
associated,
database,
entire,
microsoft,
mysql,
oracle,
particulartable,
server,
sql,
table,
triggers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment