DBCC TRACEON - Enable trace flags.
DBCC TRACEOFF - Disable trace flags.
DBCC TRACESTATUS - Display the status of trace flags.

Syntax
      DBCC TRACEON ( trace# [ ,...n ][ , -1 ] ) [WITH NO_INFOMSGS]

      DBCC TRACEOFF ( trace# [ ,...n ] [ , -1 ] ) [WITH NO_INFOMSGS]

      DBCC TRACESTATUS ( [ [trace# [,...n ] ]  [,] [-1] ] ) [WITH NO_INFOMSGS]

 Key:

   trace#      - Number of the trace flag(s)
   -1          - Display the status of trace flags that are enabled globally.
   NO_INFOMSGS - Suppress all information messages.

By default all trace flags that are enabled for the session are displayed.

Examples

-- Turn flag on
DBCC TRACEON (3205)
GO -- Turn flag on globally DBCC TRACEON (2528, -1)
GO -- Turn flag off DBCC TRACEOFF (3205);
GO -- Show flag status DBCC TRACESTATUS (2528, 3205)
GO

“Every branch of human knowledge, if traced up to its source and final principles vanishes into a mystery” ~ Arthur Machen

Related commands

Trace Flags
Equivalent Oracle command: Server Parameters


 
Copyright © 1999-2024 SS64.com
Some rights reserved