To find a list of all the triggers in the specific database , we can use the following query:
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'
No comments:
Post a Comment