Viewing Trigger Creation and Update Detail in SQL Server
Hello everyone,
In this article, I will try to give information about the creation and updating of Trigger in SQL Server.
In SQL Server, in some cases, you may want to view the creation and update details of the Trigger.
You can easily do this using the code below.
SELECT o.name AS [Trigger Name],
CASE
WHEN o.type = 'TR' THEN
'SQL DML Trigger'
WHEN o.type = 'TA' THEN
'DML Assembly Trigger'
END AS [Trigger Type],
sc.name AS [Schema_Name],
OBJECT_NAME(parent_object_id) AS [Table Name],
o.create_date [Trigger Create Date],
o.modify_date [Trigger Modified Date]
FROM sys.objects o
INNER JOIN sys.schemas sc
ON o.schema_id = sc.schema_id
WHERE (
type = 'TR'
OR type = 'TA'
);
When you run the above code, you will see a result similar to the one below.
As you can see, we have displayed the creation and updating details of the Trigger.
Good luck to everyone in business and life.