Return a List of Server Trigger Events in SQL Server

In SQL Server, you can use the sys.server_trigger_events catalog view to return a list of server trigger events.

More specifically, this view contains one row for each event for which a server-level (synchronous) trigger fires.

Example

Here’s an example of querying the sys.server_trigger_events view.

SELECT * FROM sys.server_trigger_events;

Result (using vertical output):

-[ RECORD 1 ]-------------------------
object_id             | 759673754
type                  | 147
type_desc             | LOGON
is_trigger_event      | 1
is_first              | 0
is_last               | 0
event_group_type      | NULL
event_group_type_desc | NULL
(1 row affected)

I used vertical output in order to make it easier to read the result (so that you don’t have to scroll sideways).

In my case, there is only one trigger event.

Note that this view imports most of its columns from the sys.server_events view.

The only ones that are specific to this view is is_first and is_last.

The is_first column specifies that the trigger is marked to be the first to fire for this event.

The is_last column specifies that the trigger is marked to be the last to fire for this event.