when I run the following script in one of my databases:
SELECT * FROM SYS.triggers
when I try to find out about sys.triggers
Contains a row for each object that is a trigger, with a type of TR or
TA. DML trigger names are schema-scoped and, therefore, are visible in
sys.objects. DDL trigger names are scoped by the parent entity and are
only visible in this view.
How then, do I get the database triggers definition?
Best Answer
You can use
OBJECT_DEFINITION()
.Shameless copy and paste example from the docs: