Situatie
Mai jos este o procedura ce listeaza toate obiectele de tip trigger de pe o baza de date, cu informatii despre faptul daca sunt activi sau nu, daca sunt instead of sau nu, cand au fost creati, cand au fost modificati ultima oara, etc.
Solutie
create procedure ListAllTriggers
as
select
[object_id] as IdTrigger,
name as NumeTrigger,
parent_class_desc as TipTrigger,
create_date as DataCreareTrigger,
modify_date as DataUltimaModificareTrigger,
case
when is_disabled = 1
then ‘DISABLED’
else ‘ACTIV’
end as TrigerActivSauNu,
case
when is_instead_of_trigger = 1
then ‘DA’
else ‘NU’
end as EsteInsteadOfTrigger
from sys.triggers
order by 4
Leave A Comment?