TechNet
Export (0) Print
Expand All

Delete a Trace (Transact-SQL)

 

Applies To: SQL Server 2016

This topic describes how to use stored procedures to delete a trace.

For an example of using trace stored procedures, see Create a Trace (Transact-SQL).

To delete a trace

  1. Execute sp_trace_setstatus by specifying @status = 0 to stop the trace.

  2. Execute sp_trace_setstatus by specifying @status = 2 to close the trace and delete its information from the server.

System_CAPS_ICON_note.jpg Note


A trace must be stopped first before it can be closed.

sp_trace_setstatus (Transact-SQL)
System Stored Procedures (Transact-SQL)
SQL Server Profiler Stored Procedures (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft