Thursday, January 19, 2012

TRACE FLAGS


Trace Flags are used to temporarily enable or disable specific behavior of SQL Server. For example, if the Trace Flag 7806 is set SQL Server 2005 allows Dedicated Administration Connections.
SQL Server 2005 supports Session level Trace Flags and Global level Trace Flags.
Global trace flags are active at the server level and are visible to all the existing connections and new connection of the server.
Session level trace flags are active only to the current user session and they are visible to the current connection.
No. Session B will not be able to see any changes.
Trace flags are configured can be configured in two way. Using either DBCC TRACEON/TRACEOFF to configure session and global trace flags or -T startup option of SQL Server service to enable trace flags globally.
No. It is not possible to enable session level trace flags using –T startup option. The startup option is used only to enable global trace flags.
Execute the command DBCC TRACEON 3205
Execute the command DBCC TRACEON 3205, -1. Note the extra parameter -1 which instructs to apply the trace flag globally.