How To See the Event List of an Existing Trigger using sys.trigger_events?
Submitted by: AdministratorIf what are the DML events an existing trigger is handling, you can use the catalog view, sys.trigger_events. You need to join sys.trigger_events and sys.triggers to get a better list as shown in this tutorial example:
USE GlobalGuideLineDatabase
GO
SELECT t.name, e.type, e.type_desc
FROM sys.trigger_events AS e, sys.triggers AS t
WHERE e.object_id = t.object_id
GO
<pre>name type type_desc
-------------- ------ ---------
dml_message 1 INSERT
dml_message 2 UPDATE
dml_message 3 DELETE
new_user 1 INSERT
(4 row(s) affected)</pre>
The list clearly shows that dml_message handles 3 events: INSERT, UPDATE and DELETE.
Submitted by: Administrator
USE GlobalGuideLineDatabase
GO
SELECT t.name, e.type, e.type_desc
FROM sys.trigger_events AS e, sys.triggers AS t
WHERE e.object_id = t.object_id
GO
<pre>name type type_desc
-------------- ------ ---------
dml_message 1 INSERT
dml_message 2 UPDATE
dml_message 3 DELETE
new_user 1 INSERT
(4 row(s) affected)</pre>
The list clearly shows that dml_message handles 3 events: INSERT, UPDATE and DELETE.
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | What Is a Transact-SQL Statement Batch in MS SQL Server? |
☺ | How To Create a Testing Table with Test Data in MS SQL Server? |
☺ | How To Get the Definition of a View Out of the SQL Server? |
☺ | How To Use Subqueries with the EXISTS Operators in MS SQL Server? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |