You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
981 B

SELECT T.object_id, O.type AS ObjectType, ISNULL(CONVERT(varchar,AM.execute_as_principal_id),'CALLER') as ExecuteAs, AF.name AS assembly_name, AM.assembly_class, AM.assembly_id, AM.assembly_method, T.type, CAST(ISNULL(tei.object_id,0) AS bit) AS IsInsert, CAST(ISNULL(teu.object_id,0) AS bit) AS IsUpdate, CAST(ISNULL(ted.object_id,0) AS bit) AS IsDelete, T.parent_id, S.name AS Owner,T.name,is_disabled,is_not_for_replication,is_instead_of_trigger
FROM sys.triggers T
INNER JOIN sys.objects O ON O.object_id = T.parent_id
INNER JOIN sys.schemas S ON S.schema_id = O.schema_id
LEFT JOIN sys.trigger_events AS tei ON tei.object_id = T.object_id and tei.type=1
LEFT JOIN sys.trigger_events AS teu ON teu.object_id = T.object_id and teu.type=2
LEFT JOIN sys.trigger_events AS ted ON ted.object_id = T.object_id and ted.type=3
LEFT JOIN sys.assembly_modules AM ON AM.object_id = T.object_id
LEFT JOIN sys.assemblies AF ON AF.assembly_id = AM.assembly_id
ORDER BY T.parent_id