SQL Server trace

  • I have a SQL Server trace running, how can I disabeled it?

    Thank you

  • See this really good article to achieve what you want.

    http://www.sqlservercentral.com/articles/Administration/howtousetraceflagsinsqlserver2000/1860/

    :w00t:

  • This should help you Find all the traces on the server, and builds the commands to stop/drop the trace as well...

    avoid using the command to drop teh default trace(is_default = 1 column); that trace is very valuable.

    /*--results

    TraceStatus StopTraceCommand DropTraceCommand id moreColumns...

    Running exec sp_trace_setstatus 1, 0 exec sp_trace_setstatus 1, 2 1 moreColumns...

    */

    select

    CASE

    WHEN status = 1

    THEN 'Running'

    ELSE 'Stopped'

    END AS TraceStatus,

    'exec sp_trace_setstatus ' + convert(varchar,id) + ', 0' As StopTraceCommand,

    'exec sp_trace_setstatus ' + convert(varchar,id) + ', 2' As DropTraceCommand,

    * from sys.traces

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thank you

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply