Trying to Stop Trace and receiving permissions error

  • I'm sysadmin on a sql 2005 machine. Trying to STOP a TRACE and receiving error message:

    You do not have permission to run 'SP_TRACE_SETSTATUS'

    I'm using this syntax to STOP my Trace ID=1:

    -- a) Stop a Trace:

    DECLARE @TraceId int

    SET @TraceId=1

    EXEC sp_trace_setstatus @TraceId, 0

    -- b) Clear a TRACE:

    DECLARE @TraceId int

    SET @TraceId=1

    EXEC sp_trace_setstatus @TraceId, 2

    BT
  • Is it possible for u to stop the server at night time and then delete the file from error log where this Trace might be active?

  • Check if your id has permissions. since you say that you are a sysadmin i would see that this should execute successfully. check the rights.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • Pleaze find link, on Tracing & how to configure performance on tracing stuff///etc., Hope this will find somehow useful to you in adopting these terminologies....

    http://msdn2.microsoft.com/en-us/library/ms190221.aspx

  • I could be mistaken, but is that the default trace you're trying to delete?

    If so, change the server's property to prevent it from starting. I don't think you can close the default trace with sp_trace...

    exec sp_configure 'default trace enabled', 0

    reconfigure

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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