Skip to content

Commit f59f7df

Browse files
authored
Include firt demo script, update links, add info
1 parent 5bd1a3d commit f59f7df

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

SQL Server Trace Flag.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Microsoft SQL Server Trace Flags
22
Complete list of Microsoft SQL Server trace flags (**590** trace flags)
33

4-
**REMEMBER: Be extremely careful with trace flags, test in your test environment first. And consult professionals first if you are the slightest uncertain about the effects of your changes.**
4+
**REMEMBER: Be extremely careful with trace flags, test in your test environment first. And consult professionals first if you are the slightest uncertain about the effects of your changes.**
55

6-
**Some trace flags were introduced in specific SQL Server versions.
6+
**Some trace flags were introduced in specific SQL Server versions.
77
For more information on the applicable version, see the Microsoft Support article associated with a specific trace flag.**
88

9-
**Trace flag behavior may not be supported in future releases of SQL Server.**
9+
**Trace flag behavior may not be supported in future releases of SQL Server.**
1010

1111
Headers:
1212
- [Unknown trace flags](#unknown-trace-flags")
@@ -64,6 +64,7 @@ A lowercase "t" is accepted by SQL Server, but this sets other internal trace fl
6464
- Scott Caldwell ([b](https://blog.rdx.com/) | [t](https://twitter.com/sqldroid))
6565
- Mike Fal ([b](http://www.mikefal.net) | [t](https://twitter.com/Mike_Fal))
6666
- Prince Kumar Rastogi ([b](http://www.sqlservergeeks.com/) | [t](https://twitter.com/princerastogi2))
67+
- Kendra Little ([b](http://www.littlekendra.com/) | [t](https://twitter.com/Kendra_Little))
6768

6869

6970
<a id="unknown-trace-flags"></a>
@@ -99,7 +100,7 @@ Trace Flags are settings that in some way or another alters the behavior of vari
99100

100101
<a id="how-do-i-turn-trace-flags-on-and-off"></a>
101102
## How do I turn Trace Flags on and off?
102-
- You can use the [DBCC TRACEON](https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-transact-sql "Official Microsoft Docs DBCC TRACEON Article") and [DBCC TRACEOFF](https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceoff-transact-sql "Official Microsoft Docs DBCC TRACEOFF Article") commands
103+
- You can use the [DBCC TRACEON] and [DBCC TRACEOFF] commands
103104
- You can use the [-T option](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/database-engine-service-startup-options "Official Microsoft Docs Database Engine Service Startup Options Article") in the startup configuration for the SQL Server Service.
104105
**When specifying a trace flag with the `-T` option, use an uppercase `"T"` to pass the trace flag number. A lowercase `"t"` is accepted by SQL Server, but this sets other internal trace flags that are required only by SQL Server support engineers. (Parameters specified in the Control Panel startup window are not read.)**
105106
- You can also use the hint [QUERYTRACEON](https://support.microsoft.com/help/2801413 "Official QUERYTRACEON KB Article") in your queries: **&lt;querytraceon_hint ::= {QUERYTRACEON trace_flag_number}>**
@@ -230,13 +231,13 @@ Use this trace flag if SQL Server is experiencing high number of [QDS_LOADDB](ht
230231

231232
<a id="trace-flags-list"></a>
232233
## Trace Flags List
233-
Summary: **588 trace flags**
234+
Summary: **590 trace flags**
234235

235236

236237
<a id="-1"></a>
237238
#### Trace Flag: -1
238239
Function: Sets trace flags for all client connections, rather than for a single client connection.
239-
Because trace flags set using the -T command-line option automatically apply to all connections, this trace flag is used only when setting trace flags using DBCC TRACEON and DBCC TRACEOFF.<br />
240+
Because trace flags set using the -T command-line option automatically apply to all connections, this trace flag is used only when setting trace flags using [DBCC TRACEON] and [DBCC TRACEOFF].<br />
240241
Link: http://www.sql-server-performance.com/2002/traceflags/
241242

242243

@@ -924,7 +925,8 @@ Link: https://blogs.msdn.microsoft.com/arvindsh/2014/02/24/tracking-tempdb-inter
924925
<a id="1117"></a>
925926
#### Trace Flag: 1117
926927
Function: When a file in the filegroup meets the autogrow threshold, all files in the filegroup grow.<br />
927-
**Note: Beginning with SQL Server 2016 this behavior is controlled by the AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES option of ALTER DATABASE, and trace flag 1117 has no affect. For more information, see ALTER DATABASE File and Filegroup Options (Transact-SQL).**<br />
928+
**Note: Beginning with SQL Server 2016 this behavior is controlled by the AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES option of ALTER DATABASE, and trace flag 1117 has no affect.
929+
For more information, see [ALTER DATABASE File and Filegroup Options (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-file-and-filegroup-options).**<br />
928930
Link: https://www.littlekendra.com/2017/01/03/parallelism-and-tempdb-data-file-usage-in-sql-server/<br />
929931
Link: [SQL Server 2016 : Getting tempdb a little more right]<br />
930932
Link: [Docs Trace Flags]<br />
@@ -1000,7 +1002,7 @@ Link: None
10001002
Function: Prints detailed lock information as every request for a lock is made (the process ID and type of lock requested)<br />
10011003
Link: [TECHNET List Of SQL Server Trace Flags]<br />
10021004
Link: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2008/03/30/tempdb-table-variable-vs-local-temporary-table<br />
1003-
Link: https://support.microsoft.com/help/169960/inf-analyzing-and-avoiding-deadlocks-in-sql-server<br />
1005+
Link: [KB169960]<br />
10041006
Link: [Important Trace Flags That Every DBA Should Know]<br />
10051007
Scope: ?
10061008

@@ -1031,13 +1033,13 @@ Link: https://support.microsoft.com/help/832524/sql-server-technical-bulletin---
10311033
<a id="1206"></a>
10321034
#### Trace Flag: 1206
10331035
Function: Used to complement flag 1204 by displaying other locks held by deadlock parties<br />
1034-
Link: https://support.microsoft.com/help/169960/inf-analyzing-and-avoiding-deadlocks-in-sql-server
1036+
Link: [KB169960]
10351037

10361038

10371039
<a id="1208"></a>
10381040
#### Trace Flag: 1208
10391041
Function: KB: “Prints the host name and program name supplied by the client. This can help identify a client involved in a deadlock, assuming the client specifies a unique value for each connection.”<br />
1040-
Link: https://support.microsoft.com/help/169960/inf-analyzing-and-avoiding-deadlocks-in-sql-server
1042+
Link: [KB169960]
10411043

10421044

10431045
<a id="1211"></a>
@@ -3639,7 +3641,8 @@ We can use this trace flag to troubleshooting the query performance without chan
36393641
Link: http://download.microsoft.com/download/6/e/5/6e52bf39-0519-42b7-b806-c32905f4a066/eim_perf_flowchart_final.pdf<br />
36403642
Link: http://sqlblog.com/blogs/kalen_delaney/archive/2008/02/26/lost-without-a-trace.aspx<br />
36413643
Link: http://www.sqlservergeeks.com/sql-server-trace-flag-8602/<br />
3642-
Scope: global only
3644+
Scope: global only<br />
3645+
Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_8602.sql
36433646

36443647

36453648
<a id="8605"></a>
@@ -4882,6 +4885,8 @@ Scope: ?
48824885

48834886

48844887
[Query Store Trace Flags]: https://www.sqlskills.com/blogs/erin/query-store-trace-flags/
4888+
[DBCC TRACEON]:https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-transact-sql
4889+
[DBCC TRACEOFF]:https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceoff-transact-sql
48854890
[Docs Trace Flags]: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql
48864891
[DBCC CHECKDB]: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-checkdb-transact-sql
48874892
[DBCC CHECKTABLE]: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-checktable-transact-sql
@@ -4937,3 +4942,4 @@ Scope: ?
49374942
[DAC]:https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/diagnostic-connection-for-database-administrators
49384943
[DBCC SHOW_STATISTICS]:https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-show-statistics-transact-sql
49394944
[ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)]:https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql
4945+
[KB169960]:https://web.archive.org/web/20150111103047/http://support.microsoft.com:80/kb/169960

0 commit comments

Comments
 (0)