Modify an Existing Trace (Transact-SQL)
Applies To: SQL Server 2016
This topic describes how to use stored procedures to modify an existing trace.
If the trace is already running, execute sp_trace_setstatus by specifying @status = 0 to stop the trace.
To modify trace events, execute sp_trace_setevent by specifying the changes through the parameters. Listed in order, the parameters are:
@traceid (Trace ID)
@eventid (Event ID)
@columnid (Column ID)
When you modify the @on parameter, keep in mind its interaction with the @columnid parameter:
ON Column ID Result ON (1) NULL Event is turned on. All columns are cleared. NOT NULL Column is turned on for the specified event. OFF (0) NULL Event is turned off. All columns are cleared. NOT NULL Column is turned off for the specified event.