CREATE EVENT TRACE
On this page
Creates a trace event.
Syntax
CREATE EVENT TRACEevent_name[ WITH (<event_characteristic>, ...) ];
Where <event_
is an key/value pair, such as:
-
Query_
captures the query texttext = on -
Duration_
traces all queries with runtimes over 1 secondthreshold_ ms = 1000 -
Trace_
traces all queries that have failed, even when their runtimes are less thanall_ failed_ executions= on Duration_
threshold_ ms
Remarks
-
The
event_
andname event_
keys are not case-sensitive.characteristic -
Currently,
Query_
is the only usable event type.completion -
The ALTER TRACE permission is required to create trace events.
-
Since
event_
key-value pairs are optional, each event trace has its own default values for a default configuration.characteristic
Last modified: February 28, 2024