SQL Flow Field Guide

sp_trace_generateevent

Check SQL Server version support in the source

Fires a user-defined event to a trace or an event session.

What changes

Input
Not stated in the Microsoft summary.
Output or change
Not stated in the Microsoft summary.

Syntax at a glance

sp_trace_generateevent
    [ @eventid = ] eventid
    [ , [ @userinfo = ] N'userinfo' ]
    [ , [ @userdata = ] userdata ]
[ ; ]

Work example

Fires a user-defined event to a trace or an event session.

Read the syntax and examples. Explain each argument and its effect before writing a call.

Check your work Which inputs are required, and what result or effect does the page document?

Open Microsoft Learn for full syntax, permissions, and details for your version.