check all Trace flag status in SQL Server

  • Hi Experts,

    How to find what all the trace flags enabled in a server???

    I had run

    DBCC Tracestatus()

    <<attachment1>>

    I had enabled few trace flags on SQLQuery1 window and run the Tracestatus command... i am able to see the open trace flags.

    But when i open the new SQL server Query Window SQLQuery2 then when i run the same command i am not able to see them.

    Result: <<DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    >>

    Help me to find all the trace flags enabled on the system.

    Thank you.

  • DBCC TRACESTATUS is how you do it.

    Tested:

    Window 1:

    DBCC TRACEON(3604, 1222, 3605, 1204, -1)

    Window 2:

    DBCC TRACESTATUS

    TraceFlagStatusGlobalSession

    1204110

    1222110

    3604110

    3605110

    Now the trace has to be enabled globally for you to see it from another connection. If you just enable the traceflag just for the session, you can only see that it's active from the session where you enabled it.

    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
  • Thank you.

    I had enabled for the session and verified on another session.

  • If you enable traceflags for a single session, they are only visible on that session, not any other.

    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 4 posts - 1 through 3 (of 3 total)

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