Quantcast
Channel: Welcome to the Database World... » Subhro Saha
Viewing all articles
Browse latest Browse all 18

SQL Server: Stop Trace using SQL command !!

$
0
0

Recently, we were experimenting with one of the 3rd party tool in our environment that internally creates Traces. After sometime, there was some issue with the 3rd party tool and we stopped using it but it continued to produce the trace files on Server.

I used the below command to stop the trace:

– To Get the Trace ID

SELECT * FROM sys.traces

– Stop Trace

DECLARE @TID INT

SET @TID = ? – Give the Trace ID retreived above

EXEC sp_trace_setstatus @TID,0
EXEC sp_trace_setstatus @TID ,2

Hope this will help you.

Cheers,

Subhro Saha


Viewing all articles
Browse latest Browse all 18

Trending Articles