Skip to content

Instantly share code, notes, and snippets.

@lionofdezert
Created August 30, 2012 17:22
Show Gist options
  • Save lionofdezert/3534159 to your computer and use it in GitHub Desktop.
Save lionofdezert/3534159 to your computer and use it in GitHub Desktop.
Stop Auto Trace
DECLARE @TraceID INT
SELECT TOP 1 @TraceID = id FROM sys.traces
WHERE path LIKE '%_AutoTrace%'
exec sp_trace_setstatus @TraceID, 0 --Stop trace
exec sp_trace_setstatus @TraceID, 2 --Close trace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment