How can I resolve a database trigger's name with built-in functions?
11
votes
2
answers
1230
views
I have a database trigger that I use to prevent me from creating certain procedures in user databases.
It appears in
Likewise, I can find it in
Is there a function that will accept a database level trigger's object id, and return its name?
sys.triggers
, with an object_id
, but I can't use the object_id
function to find it.
SELECT OBJECT_ID(t.name, t.type) AS object_id, *
FROM sys.triggers AS t;

sys.dm_exec_trigger_stats
. I can't get object_name
to resolve, but object_definition
does.
SELECT OBJECT_NAME(dets.object_id, dets.database_id) AS object_name,
OBJECT_DEFINITION(dets.object_id) AS object_definition,
*
FROM sys.dm_exec_trigger_stats AS dets;

Asked by Erik Reasonable Rates Darling
(45634 rep)
May 20, 2018, 08:48 PM
Last activity: Dec 13, 2023, 06:37 PM
Last activity: Dec 13, 2023, 06:37 PM