|
1 | 1 | # Microsoft SQL Server Trace Flags |
2 | 2 | Complete list of Microsoft SQL Server trace flags (**590** trace flags) |
3 | 3 |
|
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.** |
5 | 5 |
|
6 | | -**Some trace flags were introduced in specific SQL Server versions. |
| 6 | +⚠ **Some trace flags were introduced in specific SQL Server versions. |
7 | 7 | For more information on the applicable version, see the Microsoft Support article associated with a specific trace flag.** |
8 | 8 |
|
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.** |
10 | 10 |
|
11 | 11 | Headers: |
12 | 12 | - [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 |
64 | 64 | - Scott Caldwell ([b](https://blog.rdx.com/) | [t](https://twitter.com/sqldroid)) |
65 | 65 | - Mike Fal ([b](http://www.mikefal.net) | [t](https://twitter.com/Mike_Fal)) |
66 | 66 | - 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)) |
67 | 68 |
|
68 | 69 |
|
69 | 70 | <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 |
99 | 100 |
|
100 | 101 | <a id="how-do-i-turn-trace-flags-on-and-off"></a> |
101 | 102 | ## 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 |
103 | 104 | - 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. |
104 | 105 | **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.)** |
105 | 106 | - You can also use the hint [QUERYTRACEON](https://support.microsoft.com/help/2801413 "Official QUERYTRACEON KB Article") in your queries: **<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 |
230 | 231 |
|
231 | 232 | <a id="trace-flags-list"></a> |
232 | 233 | ## Trace Flags List |
233 | | -Summary: **588 trace flags** |
| 234 | +Summary: **590 trace flags** |
234 | 235 |
|
235 | 236 |
|
236 | 237 | <a id="-1"></a> |
237 | 238 | #### Trace Flag: -1 |
238 | 239 | 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 /> |
240 | 241 | Link: http://www.sql-server-performance.com/2002/traceflags/ |
241 | 242 |
|
242 | 243 |
|
@@ -924,7 +925,8 @@ Link: https://blogs.msdn.microsoft.com/arvindsh/2014/02/24/tracking-tempdb-inter |
924 | 925 | <a id="1117"></a> |
925 | 926 | #### Trace Flag: 1117 |
926 | 927 | 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 /> |
928 | 930 | Link: https://www.littlekendra.com/2017/01/03/parallelism-and-tempdb-data-file-usage-in-sql-server/<br /> |
929 | 931 | Link: [SQL Server 2016 : Getting tempdb a little more right]<br /> |
930 | 932 | Link: [Docs Trace Flags]<br /> |
@@ -1000,7 +1002,7 @@ Link: None |
1000 | 1002 | Function: Prints detailed lock information as every request for a lock is made (the process ID and type of lock requested)<br /> |
1001 | 1003 | Link: [TECHNET List Of SQL Server Trace Flags]<br /> |
1002 | 1004 | 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 /> |
1004 | 1006 | Link: [Important Trace Flags That Every DBA Should Know]<br /> |
1005 | 1007 | Scope: ? |
1006 | 1008 |
|
@@ -1031,13 +1033,13 @@ Link: https://support.microsoft.com/help/832524/sql-server-technical-bulletin--- |
1031 | 1033 | <a id="1206"></a> |
1032 | 1034 | #### Trace Flag: 1206 |
1033 | 1035 | 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] |
1035 | 1037 |
|
1036 | 1038 |
|
1037 | 1039 | <a id="1208"></a> |
1038 | 1040 | #### Trace Flag: 1208 |
1039 | 1041 | 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] |
1041 | 1043 |
|
1042 | 1044 |
|
1043 | 1045 | <a id="1211"></a> |
@@ -3639,7 +3641,8 @@ We can use this trace flag to troubleshooting the query performance without chan |
3639 | 3641 | Link: http://download.microsoft.com/download/6/e/5/6e52bf39-0519-42b7-b806-c32905f4a066/eim_perf_flowchart_final.pdf<br /> |
3640 | 3642 | Link: http://sqlblog.com/blogs/kalen_delaney/archive/2008/02/26/lost-without-a-trace.aspx<br /> |
3641 | 3643 | 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 |
3643 | 3646 |
|
3644 | 3647 |
|
3645 | 3648 | <a id="8605"></a> |
@@ -4882,6 +4885,8 @@ Scope: ? |
4882 | 4885 |
|
4883 | 4886 |
|
4884 | 4887 | [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 |
4885 | 4890 | [Docs Trace Flags]: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql |
4886 | 4891 | [DBCC CHECKDB]: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-checkdb-transact-sql |
4887 | 4892 | [DBCC CHECKTABLE]: https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-checktable-transact-sql |
@@ -4937,3 +4942,4 @@ Scope: ? |
4937 | 4942 | [DAC]:https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/diagnostic-connection-for-database-administrators |
4938 | 4943 | [DBCC SHOW_STATISTICS]:https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-show-statistics-transact-sql |
4939 | 4944 | [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