How to delete a trace (Transact-SQL)

How to Install SQL Server 2000

How To

How to delete a trace (Transact-SQL)

To delete a trace

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

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

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

See Also

Creating and Managing Traces and Templates

Deleting Traces

sp_trace_setstatus

System Stored Procedures (SQL Profiler Procedures)