Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 1.71 KB

File metadata and controls

45 lines (37 loc) · 1.71 KB
title Delete a Trace (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/06/2017
ms.prod sql
ms.prod_service database-engine
ms.service
ms.component sql-trace
ms.reviewer
ms.suite sql
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
traces [SQL Server], deleting
removing traces
deleting traces
ms.assetid a5502814-b281-42dd-b885-5c9368025ae6
caps.latest.revision 22
author MashaMSFT
ms.author mathoma
manager craigg

Delete a Trace (Transact-SQL)

[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md] 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.

Note

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

See Also

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