SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Server Trace Flags - Complete list

By Konstantin Taranov,

Summary: The 510 trace flags are in numerical order with a description and links for each.

Thanks to:

Trace Flag: -1
Function: Sets trace flags for all client connections, rather than for a single client connection. 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.
Link: http://www.sql-server-performance.com/2002/traceflags/

Trace Flag: 101
Function: Verbose Merge Replication logging output for troubleshooting Merger repl performance
Link: http://support.microsoft.com/kb/2892633

Trace Flag: 102
Function: Verbose Merge Replication logging to msmerge_history table for troubleshooting Merger repl performance
Link: http://support.microsoft.com/kb/2892633

Trace Flag: 105
Function: Join more than 16 tables in SQL server 6.5
Link: http://www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm

Trace Flag: 106
Function: This enables you to see the messages that are sent to and from the Publisher, if you are using Web Synchronization
Link: http://technet.microsoft.com/en-us/library/ms151872(v=sql.105).aspx

Trace Flag: 107
Function: SQL 6.5/7/8 – Interprets numbers with a decimal point as float instead of decimal
Link: None

Trace Flag: 110
Function: SQL 6.5 – Turns off ANSI select characteristics
Link: None

Trace Flag: 120
Function: FIX: Error message when you schedule a Replication Merge Agent job to run after you install SQL Server 2000 Service Pack 4: "The process could not enumerate changes at the 'Subscriber'"
Link: None

Trace Flag: 144
Function: Force server side bucketization. For legacy applications where change to client side code is not an option and when the application has queries that are improperly parameterized, this trace flag forces server side bucketization.
Link: http://blogs.msdn.microsoft.com/sqlprogrammability/2007/01/13/6-0-best-programming-practices

Trace Flag: 146
Function: Consider using when replaying against SQL 8.0, to avoid an attempt to set an encrypted connection.
Link: None

Trace Flag: 168
Function: Bugfix in ORDER BY
Link: http://support.microsoft.com/kb/926292

Trace Flag: 174
Function: Increases the SQL Server Database Engine plan cache bucket count from 40,009 to 160,001 on 64-bit systems.
Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: https://support.microsoft.com/en-us/kb/3026083
Link: MSDN ms188396
Scope: global only

Trace Flag: 204
Function: SQL 6.5 – Backward compatibility switch that enables non-ansi standard behavior. E.g. previously SQL server ignored trailing blanks in the like statement and allowed queries that contained aggregated functions to have items in the group by clause that were not in the select list.
Link: https://support.microsoft.com/en-us/help/153096/fix-sql-server-6.5-service-pack-1-fixlist

Trace Flag: 205
Function: Reports to the error log when a statistics-dependent stored procedure is being recompiled as a result of auto-update statistics.
Link: https://support.microsoft.com/en-us/kb/195565
Link: MSDN ms188396
Scope: global only

Trace Flag: 206
Function: SQL 6.5 – Provides backward compatibility for the set user statement. KB 160732
Link: None

Trace Flag: 208
Function: SET QUOTED IDENTIFIER ON
Link: None

Trace Flag: 210
Function: SQL 9 – Error when you run a query against a view: "An error occurred while executing batch"
Link: https://support.microsoft.com/en-us/kb/945892

Trace Flag: 212
Function: SQL 9 – Query may run much slower when compared to SQL 8 when you use a cursor to run the query
Link: None

Trace Flag: 220
Function: “FIX: Error Message: "Insufficient key column information for updating" Occurs in SQL Server 2000 SP3”
Link: None

Trace Flag: 221
Function: “FIX: The query runs slower than you expected when you try to parse a query in SQL Server 2000”
Link: None

Trace Flag: 222
Function: “FIX: Each query takes a long time to compile when you execute a single query or when you execute multiple concurrent queries in SQL Server 2000”
Link: None

Trace Flag: 237
Function: Tells SQL Server to use correlated sub-queries in Non-ANSI standard backward compatibility mode
Link: None

Trace Flag: 242
Function: Provides backward compatibility for correlated subqueries where non-ANSI-standard results are desired
Link: None

Trace Flag: 243
Function: Provides backward compatibility for nullability behavior. When set, SQL Server has the same nullability violation behavior as that of a ver 4.2: Processing of the entire batch is terminated if the nullability error (inserting NULL into a NOT NULL field) can be detected at compile time; Processing of offending row is skipped, but the command continues if the nullability violation is detected at run time.Behavior of SQL Server is now more consistent because nullability checks are made at run time and a nullability violation results in the command terminating and the batch or transaction process continuing.
Link: None

Trace Flag: 244
Function: Disables checking for allowed interim constraint violations. By default, SQL Server checks for and allows interim constraint violations. An interim constraint violation is caused by a change that removes the violation such that the constraint is met, all within a single statement and transaction. SQL Server checks for interim constraint violations for self-referencing DELETE statements, INSERT, and multi-row UPDATE statements. This checking requires more work tables. With this trace flag you can disallow interim constraint violations, thus requiring fewer work tables.
Link: None

Trace Flag: 246
Function: Derived or NULL columns must be explicitly named in a select…INTO or create view statement when not done they raise an error. This flag avoids that.
Link: None

Trace Flag: 253
Function: Prevents ad-hoc query plans to stay in cache
Link: http://www.sqlservercentral.com/Forums/Topic837613-146-1.aspx

Trace Flag: 257
Function: Will invoke a print algorithm on the XML output before returning it to make the XML result more readable
Link: None

Trace Flag: 260
Function: Prints versioning information about extended stored procedure dynamic-link libraries (DLLs). For more information about GetXpVersion(), see Creating Extended Stored Procedures.
Link: http://msdn.microsoft.com/en-us/library/ms164627.aspx
Link: MSDN ms188396
Scope: global or session

Trace Flag: 262
Function: SQL 7 – Trailing spaces are no longer truncated from literal strings in CASE statements
Link: None

Trace Flag: 272
Function: Generates a log record per identity increment. Can be users to convert SQL 2012 back to old style Identity behaviour
Link: http://www.big.info/2013/01/how-to-solve-sql-server-2012-identity.html
Link: https://connect.microsoft.com/SQLServer/feedback/details/739013/failover-or-restart-results-in-reseed-of-identity

Trace Flag: 274
Function: “FIX: Error message when you insert a new row into a view in SQL Server 2005: Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF”
Link: None

Trace Flag: 302
Function: Output Index Selection info
Link: http://www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm

Trace Flag: 310
Function: Outputs info about actual join order
Link: http://www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm

Trace Flag: 320
Function: Disables join-order heuristics used in ANSI joins. To see join-order heuristics use flag 310. SQL Server uses join-order heuristics to reduce of permutations when using the best join order.
Link: None

Trace Flag: 323
Function: Outputs detailed info about updates
Link: http://www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm
Link: https://support.microsoft.com/en-us/help/153096/fix-sql-server-6.5-service-pack-1-fixlist

Trace Flag: 325
Function: Prints information about the cost of using a non-clustered index or a sort to process an ORDER BY clause
Link: None

Trace Flag: 326
Function: Prints information about estimated & actual costs of sorts. Instructs server to use arithmetic averaging when calculating density instead of a geometric weighted average when updating statistics. Useful for building better stats when an index has skew on the leading column. Use only for updating the stats of a table/index with known skewed data.
Link: None

Trace Flag: 330
Function: Enables full output when using the SET SHOWPLAN_ALL option, which gives detailed information about joins
Link: None

Trace Flag: 342
Function: Disables the costing of pseudo-merge joins, thus significantly reducing time spent on the parse for certain types of large, multi-table joins. One can also use SET FORCEPLAN ON to disable the costing of pseudo-merge joins because the query is forced to use the order specified in the FROM clause.
Link: None

Trace Flag: 345
Function: Changes join order selection logic in SQL Server 6.5
Link: http://www.databasejournal.com/features/mssql/article.php/1443351/SQL-Server-65-Some-Useful-Trace-Flags.htm

Trace Flag: 445
Function: Prints ”compile issued” message in the errorlog for each compiled statement, when used together with 3605
Link: None

Trace Flag: 506
Function: Enforces SQL-92 standards regarding null values for comparisons between variables and parameters. Any comparison of variables and parameters that contain a NULL always results in a NULL.
Link: None

Trace Flag: 610
Function: Controls minimally logged inserts into indexed tables.
Link: http://msdn.microsoft.com/en-us/library/dd425070%28v=SQL.100%29.aspx
Link: https://www.pythian.com/blog/minimally-logged-operations-data-loads/
Link: https://msdn.microsoft.com/library/dd425070.aspx
Link: MSDN ms188396
Scope: global or session

Trace Flag: 611
Function: SQL 9 – When turned on, each lock escalation is recorded in the error log along with the SQL Server handle number. Aaron confirmed this still works in SQL 2014. Outputs info of the form: "Escalated locks - Reason: LOCK_THRESHOLD, Mode: S, Granularity: TABLE, Table: 222623836, HoBt: 150:256, HoBt Lock Count: 6248, Escalated Lock Count: 6249, Line Number: 1, Start Offset: 0, SQL Statement: select count(*) from dbo.BigTable"
Link: None

Trace Flag: 617
Function: SQL 9 – When turned on, each lock escalation is recorded in the error log along with the SQL Server handle number. As long as there are no SCH_M lock requests waiting in the ‘lock wait list’, the ‘lock wait list’ will be bypassed by statements issued in uncommitted read transaction isolation level. If there is a SCH_M lock request in the ‘lock wait list’, a query in uncommitted read transaction isolation level will not bypass the ‘lock wait list’, but the SCH_S lock request will go into the ‘lock wait list’. In order behind the SCH_M lock waiting in the same list. As a result the grant of the SCH_S request for such a query is dependent on the grant and release of the SCH_M lock request entering the ‘lock wait list’ earlier.
Link: https://blogs.msdn.microsoft.com/saponsqlserver/2014/01/17/new-functionality-in-sql-server-2014-part-3-low-priority-wait/

Trace Flag: 634
Function: Disables the background columnstore compression task. SQL Server periodically runs the Tuple Mover background task that compresses columnstore index rowgroups with uncompressed data, one such rowgroup at a time. Columnstore compression improves query performance but also consumes system resources. You can control the timing of columnstore compression manually, by disabling the background compression task with trace flag 634, and then explicitly invoking ALTER INDEX REORGANIZE or ALTER INDEX REBUILD at the time of your choice.
Link: Niko Neugebauer Columnstore Indexes – part 35
Link: MSDN ms188396
Scope: global only

Trace Flag: 646
Function: Serves for getting detailed information on which Columnstore were eliminated by the Query Optimiser right into the error log.
Link: Niko Neugebauer Columnstore Indexes – part 35
Link: http://www.sqlskills.com/blogs/joe/exploring-columnstore-index-metadata-segment-distribution-and-elimination-behaviors

Trace Flag: 647
Function: Avoids a new-in-SQL 2012 data check (done when adding a column to a table) that can cause ALTER TABLE... ADD operations to take a very long time. The KB has a useful query for determining the row size for a table.
Link: https://support.microsoft.com/en-us/help/2986423/fix-it-takes-a-long-time-to-add-new-columns-to-a-table-when-the-row-size-exceeds-the-maximum-allowed-size

Trace Flag: 652
Function: Disable page pre-fetching scans
Link: KB920093]
Link: MSDN ms188396
Scope: global only

Trace Flag: 653
Function: Disables read ahead for the current connection
Link: None

Trace Flag: 661
Function: Disables the ghost record removal process.
Link: KB920093
Link: MSDN ms188396
Scope: global only

Trace Flag: 662
Function: Prints detailed information about the work done by the ghost cleanup task when it runs next. Use TF 3605 to see the output in the errorlog
Link: http://blogs.msdn.com/b/sqljourney/archive/2012/07/28/an-in-depth-look-at-ghost-records-in-sql-server.aspx

Trace Flag: 669
Function: “...prevents user queries from queuing requests to the ghost cleanup process”. This flag is a workaround for stack dumps occurring right after SQL Server startup, where user queries (that queue pages for ghost cleanup) were running so quickly after SQL startup that they were queuing pages before the ghost cleanup process had actually initialized.
Link: https://support.microsoft.com/en-us/help/3027860/error-17066-or-17310-during-sql-server-startup

Trace Flag: 683
Function: According to the KB, used to workaround a bug in SQL 2000 SP3 by reverting to pre-SP3 parallel-scan behavior in parallel queries. Database-Wiki.com: “Disallow row counter and column mod counters to be partitioned”
Link: None

Trace Flag: 698
Function: SQL 9 – Performance of INSERT operations against a table with an identity column may be slow when compared to SQL 8
Link: None

Trace Flag: 699
Function: Turn off transaction logging for the entire SQL dataserver
Link: None

Trace Flag: 670, 671
Function: Disables deferred deallocation. But note Paul White’s comment on the post! The flag # may actuall by 671.
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps/

Trace Flag: 715
Function: Enables table lock for bulk load operations into a heap with no non-clustered indexes. When this trace flag is enabled, bulk load operations acquire bulk update (BU) locks when bulk copying data into a table. Bulk update (BU) locks allow multiple threads to bulk load data concurrently into the same table, while preventing other processes that are not bulk loading data from accessing the table. The behavior is similar to when the user explicitly specifies TABLOCK hint while performing bulk load, or when the sp_tableoption table lock on bulk load is enabled for a given table. However, when this trace flag is enabled, this behavior becomes default without any query or database changes.
Link: MSDN ms188396
Scope: global or session

Trace Flag: 806
Function: Turn on Page Audit functionality, to verify page validity
Link: http://technet.microsoft.com/en-au/library/cc917726.aspx
Link: http://www.sqlskills.com/blogs/paul/how-to-tell-if-the-io-subsystem-is-causing-corruptions

Trace Flag: 809
Function: SQL 8 – Limits the amount of Lazy write activity
Link: None

Trace Flag: 815
Function: SQL 8/9 – Enables latch enforcement. SQL Server 8 (with service pack 4) and SQL Server 9 can perform latch enforcement for data pages found in the buffer pool cache. Latch enforcement changes the virtual memory protection state while database page status changes from "clean" to "dirty" ("dirty" means modified through INSERT, UPDATE or DELETE operation). If an attempt is made to modify a data page while latch enforcement is set, it causes an exception and creates a mini-dump in SQL Server installation's LOG directory. Microsoft support can examine the contents of such mini-dump to determine the cause of the exception. In order to modify the data page the connection must first acquire a modification latch. Once the data modification latch is acquired the page protection is changed to read-write. Once the modification latch is released the page protection changes back to read-only.
Link: https://technet.microsoft.com/en-us/library/cc966500.aspx
Link: https://blogs.msdn.microsoft.com/psssql/2012/11/12/how-can-reference-counting-be-a-leading-memory-scribbler-cause

Trace Flag: 818
Function: Turn on ringbuffer to store info about IO write operations. Used to troubleshoot IO problems
Link: http://support.microsoft.com/kb/826433
Link: https://technet.microsoft.com/en-us/library/cc966500.aspx
Link: https://support.microsoft.com/en-us/help/828339/error-message-823-may-indicate-hardware-problems-or-system-problems-in-sql-server

Trace Flag: 822
Function: A workaround for SQL 2000 over-committing memory on the machine
Link: None

Trace Flag: 825
Function: In SQL 2000, enables Buffer Pool support for NUMA. TF 888 must be used.
Link: None

Trace Flag: 828
Function: SQL 8 - When enabled checkpoint ignores the recovery interval target and keeps steady I/O otherwise it uses recovery interval setting as a target for the length of time that checkpoint will take
Link: https://support.microsoft.com/en-gb/kb/906121 Link: https://blogs.msdn.microsoft.com/psssql/2008/04/11/how-it-works-sql-server-checkpoint-flushcache-outstanding-io-target/

Trace Flag: 830
Function: SQL 9 – Disable the reporting of CPU Drift errors in the SQL Server errorlog like SQL Server has encountered 2 occurrence(s) of I/O requests taking longer than 15 seconds to complete
Link: https://support.microsoft.com/en-us/kb/897284 Link: https://technet.microsoft.com/en-us/library/aa175396(v=SQL.80).aspx

Trace Flag: 831
Function: Protect unchanged pages in the buffer pool to catch memory corruptions
Link: None

Trace Flag: 834
Function: Uses Microsoft Windows large-page allocations for the buffer pool.
Note: If you are using the Columnstore Index feature of SQL Server 2012 to SQL Server 2016, we do not recommend turning on trace flag 834.
Link: https://support.microsoft.com/en-us/kb/920093
Link: https://support.microsoft.com/en-us/kb/3210239
Link: MSDN ms188396
Scope: global only

Trace Flag: 835
Function: SQL 9 / 10 – On 64 bit SQL Server it turns off Lock pages in memory
Link: None

Trace Flag: 836
Function: Use the max server memory option for the buffer pool
Link: KB920093 Link: https://blogs.msdn.microsoft.com/psssql/2012/12/11/how-it-works-sql-server-32-bit-paeawe-on-sql-2005-2008-and-2008-r2-not-using-as-much-ram-as-expected/

Trace Flag: 839
Function: (Apparently) forces SQL Server to treate all NUMA memory as “flat”, as if it was SMP.
Link: https://blogs.msdn.microsoft.com/psssql/2010/04/02/how-it-works-soft-numa-io-completion-thread-lazy-writer-workers-and-memory-nodes

Trace Flag: 840
Function: SQL 9 – When trace turned on, SQL Server can perform larger I/O extent reads to populate the buffer pool when SQL Server starts this populates the buffer pool faster. Additionally, the larger I/O extent reads improve the initial query compilation and the response time when SQL Server starts.
Link: https://blogs.msdn.microsoft.com/ialonso/2011/12/09/the-read-ahead-that-doesnt-count-as-read-ahead

Trace Flag: 842
Function: Use sys.dm_os_memory_node_access_stats to verify local vs. foreign memory under NUMA configurations after turning on this flag
Link: None

Trace Flag: 845
Function: Enable Lock pages in Memory on Standard Edition
Link: https://support.microsoft.com/en-gb/kb/970070 Link: https://support.microsoft.com/en-us/help/2708594/fix-locked-page-allocations-are-enabled-without-any-warning-after-you-upgrade-to-sql-server-2012

Trace Flag: 851
Function: According to Bob Ward’s PASS 2014 talk on SQL Server IO, “disable[s] BPE even if enabled via ALTER SERVER”
Link: None

Trace Flag: 888
Function: Enables support for locked pages for SQL 2000
Link: None

Trace Flag: 902
Function: Bypasses execution of database upgrade script when installing a Cumulative Update or Service Pack. If you encounter an error during script upgrade mode, it is recommended to contact Microsoft SQL Customer Service and Support (CSS) for further guidance.
Warning: This trace flag is meant for troubleshooting of failed updates during script upgrade mode, and it is not supported to run it continuously in a production environment. Database upgrade scripts needs to execute successfully for a complete install of Cumulative Updates and Service Packs. Not doing so can cause unexpected issues with your SQL Server instance.
Link: https://support.microsoft.com/en-us/kb/2163980
Link: MSDN ms188396
Scope: global only

Trace Flag: 916
Function: The KB article references the flag in the context of seeing a Profiler dump
Link: None

Trace Flag: 1106
Function: SQL 9 - Used space in tempdb increases continuously when you run a query that creates internal objects in tempdb
Link: https://support.microsoft.com/en-gb/kb/947204
Link: https://blogs.msdn.microsoft.com/arvindsh/2014/02/24/tracking-tempdb-internal-object-space-usage-in-sql-2012

Trace Flag: 1117
Function: When a file in the filegroup meets the autogrow threshold, all files in the filegroup grow.
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).
Link: https://www.littlekendra.com/2017/01/03/parallelism-and-tempdb-data-file-usage-in-sql-server/
Link: SQL Server 2016 : Getting tempdb a little more right
Link: MSDN ms188396
Link: http://www.sqlskills.com/blogs/paul/tempdb-configuration-survey-results-and-advice Link: https://blogs.msdn.microsoft.com/ialonso/2011/12/01/attempt-to-grow-all-files-in-one-filegroup-and-not-just-the-one-next-in-the-autogrowth-chain-using-trace-flag-1117 Link: http://sql-articles.com/articles/general/day-6trace-flag-1117-auto-grow-equally-in-all-data-file Scope: global only

Trace Flag: 1118
Function: Removes most single page allocations on the server, reducing contention on the SGAM page. When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents). Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent). The SGAM page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations are occurring. This trace flag allocates all eight pages from the same extent when creating new objects, minimizing the need to scan the SGAM page.
Note: Beginning with SQL Server 2016 this behavior is controlled by the SET MIXED_PAGE_ALLOCATION option of ALTER DATABASE, and trace flag 1118 has no affect. For more information, see ALTER DATABASE SET Options (Transact-SQL).
Link: http://blogs.msdn.com/b/psssql/archive/2008/12/17/sql-server-2005-and-2008-trace-flag-1118-t1118-usage.aspx
Link: http://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/
Link: https://support.microsoft.com/en-us/kb/328551
Link: SQL Server 2016 : Getting tempdb a little more right
Link: MSDN ms188396
Link: https://chrisadkin.org/2015/04/14/well-known-and-not-so-well-known-sql-server-tuning-knobs-and-switches
Scope: global only

Trace Flag: 1119
Function: Turns off mixed extent allocation (Similar to 1118?)
Link: TECHNET List Of SQL Server Trace Flags

Trace Flag: 1124
Function: Unknown. Has been reportedly found turned on in some SQL Server instances running Dynamics AX. Also rumored to be invalid in public builds of SQL Server
Link: None

Trace Flag: 1140
Function: A workaround for a bug in SQL 2005 SP2, SP3, and SQL 2008, where mixed page allocations climb continually, due to a change in the way that mixed-page allocations are done.
Link: None

Trace Flag: 1165
Function: This presentation by Bob Ward says that this TF outputs the recalculated #’s (every 8192 allocations) for the proportional fill algorithm in database allocation when multiple files are present..
Link: None

Trace Flag: 1180
Function: SQL 7 - Forces allocation to use free pages for text or image data and maintain efficiency of storage. Helpful in case when DBCC SHRINKFILE and SHRINKDATABASE commands may not work because of sparsely populated text, ntext, or image columns.
Link: None

Trace Flag: 1197
Function: Applies only in the case of SQL 7 – SP3, similar with trace flag 1180
Link: None

Trace Flag: 1200
Function: Prints detailed lock information as every request for a lock is made (the process ID and type of lock requested)
Link: TECHNET List Of SQL Server Trace Flags Link: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2008/03/30/tempdb-table-variable-vs-local-temporary-table
Link: https://support.microsoft.com/en-us/help/169960/inf-analyzing-and-avoiding-deadlocks-in-sql-server

Trace Flag: 1202
Function: Insert blocked lock requests into syslocks
Link: None

Trace Flag: 1204
Function: Returns the resources and types of locks participating in a deadlock and also the current command affected.
Link: https://support.microsoft.com/en-us/kb/832524
Link: MSDN ms188396
Scope: global only

Trace Flag: 1205
Function: More detailed information about the command being executed at the time of a deadlock. Documented in SQL 7 BOL.
Link: https://support.microsoft.com/en-us/help/832524/sql-server-technical-bulletin---how-to-resolve-a-deadlock

Trace Flag: 1206
Function: Used to complement flag 1204 by displaying other locks held by deadlock parties
Link: https://support.microsoft.com/en-us/help/169960/inf-analyzing-and-avoiding-deadlocks-in-sql-server

Trace Flag: 1208
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.”
Link: https://support.microsoft.com/en-us/help/169960/inf-analyzing-and-avoiding-deadlocks-in-sql-server

Trace Flag: 1211
Function: Disables lock escalation based on memory pressure, or based on number of locks. The SQL Server Database Engine will not escalate row or page locks to table locks. Using this trace flag can generate excessive numbers of locks. This can slow the performance of the Database Engine, or cause 1204 errors (unable to allocate lock resource) because of insufficient memory. If both trace flag 1211 and 1224 are set, 1211 takes precedence over 1224. However, because trace flag 1211 prevents escalation in every case, even under memory pressure, we recommend that you use 1224. This helps avoid "out-of-locks" errors when many locks are being used.
Link: MSDN ms188396
Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2330-lock-escalation
Scope: global or session

Trace Flag: 1216
Function: SQL 7 - Disables Health reporting. Lock monitor when detects a (worker thread) resource level blocking scenario. If a SPID that owns a lock is currently queued to the scheduler, because all the assigned worker threads have been created and all the assigned worker threads are in an un-resolvable wait state, the following error message is written to the SQL Server error log: Error 1223: Process ID %d:%d cannot acquire lock "%s" on resource %s because a potential deadlock exists on Scheduler %d for the resource. Process ID %d:% d holds a lock "%h" on this resource.
Link: None

Trace Flag: 1217
Function: Disables (for 7.0) the “UMS Health” reporting messages described in the KB article.
Link: None

Trace Flag: 1222
Function: Returns the resources and types of locks that are participating in a deadlock and also the current command affected, in an XML format that does not comply with any XSD schema.
Link: MSDN ms188396
Link: https://blog.sqlauthority.com/2017/01/09/sql-server-get-historical-deadlock-information-system-health-extended-events
Scope: global only

Trace Flag: 1224
Function: Disables lock escalation based on the number of locks. However, memory pressure can still activate lock escalation. The Database Engine escalates row or page locks to table (or partition) locks if the amount of memory used by lock objects exceeds one of the following conditions:

  • Forty percent of the memory that is used by Database Engine. This is applicable only when the locks parameter of sp_configure is set to 0.
  • Forty percent of the lock memory that is configured by using the locks parameter of sp_configure.

For more information, see Server Configuration Options (SQL Server). If both trace flag 1211 and 1224 are set, 1211 takes precedence over 1224. However, because trace flag 1211 prevents escalation in every case, even under memory pressure, we recommend that you use 1224. This helps avoid "out-of-locks" errors when many locks are being used.
Note: Lock escalation to the table- or HoBT-level granularity can also be controlled by using the LOCK_ESCALATION option of the ALTER TABLE statement.
Link: MSDN ms188396
Scope: global or session

Trace Flag: 1228
Function: Enable lock partitioning. By default, lock partitioning is enabled when a server has 16 or more CPUs. Otherwise, lock partitioning is disabled. Trace flag 1228 enables lock partitioning for 2 or more CPUs. Trace flag 1229 disables lock partitioning. Trace flag 1229 overrides trace flag 1228 if trace flag 1228 is also set. Lock partitioning is useful on multiple-CPU servers where some tables have very high lock rates. You can turn on trace flag 1228 and trace flag 1229 only at startup.
Link: Trace Flag 1228 and 1229
Link: Microsoft SQL Server 2005 TPC-C Trace Flags

Trace Flag: 1229
Function: Enable lock partitioning. By default, lock partitioning is enabled when a server has 16 or more CPUs. Otherwise, lock partitioning is disabled. Trace flag 1228 enables lock partitioning for 2 or more CPUs. Trace flag 1229 disables lock partitioning. Trace flag 1229 overrides trace flag 1228 if trace flag 1228 is also set. Lock partitioning is useful on multiple-CPU servers where some tables have very high lock rates. You can turn on trace flag 1228 and trace flag 1229 only at startup.
Link: Trace Flag 1228 and 1229
Link: Microsoft SQL Server 2005 TPC-C Trace Flags

Trace Flag: 1236
Function: Enables database lock partitioning. Fixes performance problem in scenarios with high lock activity in SQL 2012 and SQL 2014.
Note: Beginning with SQL Server 2012 SP3 and SQL Server 2014 SP1 this behavior is controlled by the engine and trace flag 1236 has no effect.
Link: https://support.microsoft.com/en-us/kb/2926217
Link: MSDN ms188396
Scope: global only

Trace Flag: 1260
Function: Disabled mini-dump for non-yield condition. Disables mini-dump generation for "any of the 17883, 17884, 17887, or 17888 errors. The trace flag can be used in conjunction with trace flag –T1262. For example, you could enable –T1262 to get 10- and a 60-second interval reporting and also enable – T1260 to avoid getting mini-dumps."
Link: A Topical Collection of SQL Server Flags v6
Link: How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888
Link: MSDN ms188396
Scope: global only

Trace Flag: 1261
Function: SQL 8 - Disables Health reporting. Lock monitor when detects a (worker thread) resource level blocking scenario. If a SPID that owns a lock is currently queued to the scheduler, because all the assigned worker threads have been created and all the assigned worker threads are in an un-resolvable wait state, the following error message is written to the SQL Server error log: Error 1229: Process ID %d:%d owns resources that are blocking processes on scheduler %d.
Link: None

Trace Flag: 1262
Function: The default behavior (for 1788* errors) is for SQL to generate a mini-dump on the first occurrence, but never after. 1262 changes the behavior: “When –T1262 is enabled, a mini-dump is generated when the non-yielding condition is declared (15 seconds) and at subsequent 60-second intervals for the same non-yield occurrence. A new nonDiagCorrect17883etc; yielding occurrence causes dump captures to occur again.” In SQL 2000 this was a startup-only flag; in 2005+ it can be enabled via TRACEON. Note that the flag is also covered in Khen2005, p400, but with no new information.
Link: A Topical Collection of SQL Server Flags v6
Link: How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888

Trace Flag: 1264
Function: Collect process names in non-yielding scenario memory dumps
Link: A Topical Collection of SQL Server Flags v6
Link: http://support.microsoft.com/kb/2630458/en-us

Trace Flag: 1400
Function: SQL 9 RTM – Enables creation of database mirroring endpoint, which is required for setting up and using database mirroring
Link: None

Trace Flag: 1439
Function: Trace database restart and failover messages to SQL Errorlog for mirrored databases
Link: Trace flags in sql server from trace flag 902 to trace flag 1462

Trace Flag: 1448
Function: Enables the replication log reader to move forward even if the async secondaries have not acknowledged the reception of a change. Even with this trace flag enabled the log reader always waits for the sync secondaries. The log reader will not go beyond the min ack of the sync secondaries. This trace flag applies to the instance of SQL Server, not just an availability group, an availability database, or a log reader instance. Takes effect immediately without a restart. This trace flag can be activated ahead of time or when an async secondary fails.
Link: MSDN ms188396
Scope: global only

Trace Flag: 1449
Function: When you use SNAC to connect to an instance of a principal server in a database mirroring session: "The connection attempted to fail over to a server that does not have a failover partner".
Link: https://support.microsoft.com/en-gb/kb/936179

Trace Flag: 1462
Function: Disables log stream compression for asynchronous availability groups. This feature is enabled by default on asynchronous availability groups in order to optimize network bandwidth.
Link: MSDN mt736907
Link: MSDN ms188396
Link: http://www.sqlskills.com/blogs/paul/sql-server-2008-performance-boost-for-database-mirroring
Link: http://sqlblog.com/blogs/joe_chang/archive/2014/03/13/hekaton-and-benchmarks.aspx
Link: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0CCYQFjAB&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F0%2FF%2FB%2F0FBFAA46-2BFD-478F-8E56-7BF3C672DF9D%2FSQLCAT%27s%2520Guide%2520to%2520High%2520Availability%2520Disaster%2520Recovery.pdf&ei=4eGJVfzVHI35oASj25ygBg&usg=AFQjCNHWYH0t3bF8HqBuNuutrielPX3hJg&sig2=xno-YS7agP9DRG-CzNe0Ug&bvm=bv.96339352,bs.1,d.b2w
Scope: global only

Trace Flag: 1482
Function: Prints information to the Error Log (3605 is not necessary) for a variety of transaction log operations are done, including when the MinLSN value is reset, when a VLF is formatted, etc.
Link: None

Trace Flag: 1504
Function: Dynamic memory grant expansion can also help with parallel index build plans where the distribution of rows across threads is uneven. The amount of memory that can be consumed this way is not unlimited, however. SQL Server checks each time an expansion is needed to see if the request is reasonable given the resources available at that time. Some insight to this process can be obtained by enabling undocumented trace flag 1504, together with 3604 (for message output to the console) or 3605 (output to the SQL Server error log). If the index build plan is parallel, only 3605 is effective because parallel workers cannot send trace messages cross-thread to the console.
Link: Internals of the Seven SQL Server Sorts – Part 1

Trace Flag: 1603
Function: Use standard disk I/O (i.e. turn off asynchronous I/O)
Link: None

Trace Flag: 1604
Function: Once enabled at start up makes SQL Server output information regarding memory allocation requests
Link: None

Trace Flag: 1609
Function: Turns on the unpacking and checking of RPC information in Open Data Services. Used only when applications depend on the old behavior.
Link: None

Trace Flag: 1610
Function: Boot the SQL dataserver with TCP_NODELAY enabled
Link: None

Trace Flag: 1611
Function: If possible, pin shared memory -- check errorlog for success/failure
Link: None

Trace Flag: 1613
Function: Set affinity of the SQL data server engine's onto particular CPUs -- usually pins engine 0 to processor 0, engine 1 to processor 1...
Link: None

Trace Flag: 1615
Function: Khen2005, page 385 (paraphrased): directs SQL to use threads instead of fiber even if the “lightweight pooling” config option is on. (Apparently, sometimes SQL wouldn’t start successfully when using lightweight pooling, and so this lets you get SQL up and running, so that you can turn the config option off)
Link: None

Trace Flag: 1704
Function: Prints information when a temporary table is created or dropped
Link: None

Trace Flag: 1717
Function: MSShipped bit will be set automatically at Create time when creating stored procedures
Link: None

Trace Flag: 1800
Function: Enables SQL Server optimization when disks of different sector sizes are used for primary and secondary replica log files, in SQL Server AG and Log Shipping environments.
Link: https://support.microsoft.com/en-us/kb/3009974
Link: MSDN ms188396
Scope: global only

Trace Flag: 1802
Function: SQL 9 - After detaching a database that resides on network-attached storage, you cannot reattach the SQL Server database
Link: https://support.microsoft.com/en-us/kb/922804

Trace Flag: 1806
Function: Disable Instant File Initialization
Link: http://technet.microsoft.com/en-au/library/cc917726.aspx Link: https://blogs.msdn.microsoft.com/sql_pfe_blog/2009/12/22/how-and-why-to-enable-instant-file-initialization Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-330-instant-file-initialization-can-be-controlled-from-within-sql-server Link: https://support.microsoft.com/en-us/help/2574695/file-initialization-takes-a-long-time-for-sql-server-database-related-operations

Trace Flag: 1807
Function: Enable option to have database files on SMB share for SQL Server 2008 and 2008R2
Link: http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive.aspx Link: https://support.microsoft.com/en-us/help/304261/description-of-support-for-network-database-files-in-sql-server

Trace Flag: 1808
Function: Directs SQL Server to ignore auto-closing databases even if the Auto-close property is set to ON. Must be set globally. Present in Yukon forward
Link: https://blogs.msdn.microsoft.com/ialonso/2012/04/11/want-your-sql-server-to-simply-ignore-the-auto_close-setting-for-all-open-databases-for-which-it-has-been-enabled

Trace Flag: 1810
Function: Prints the file create/open/close timings
Link: None

Trace Flag: 1816
Function: Bob Ward briefly references this flag in his PASS 2014 SQL Server IO talk, saying that it “could provide more details around errors” that occur with IO done to SQL data files in Azure Storage.
Link: None

Trace Flag: 1851
Function: Anecdotally, from a JustDave’s notes on an Amanda Ford talk at SQL Relay Reading 2014: “...disables the automerge functionality for in-memory oltp”
Link: https://justdaveinfo.wordpress.com/2014/10/16/october-13-microsoft-sql-relay-reading

Trace Flag: 1903
Function: SQL 8 - When you capture a SQL Profiler trace in a file and then you try to import the trace files into tables by using the fn_trace_gettable function no rows may be returned
Link: Note

Trace Flag: 2301
Function: Enable advanced decision support optimizations
Link: KB920093
Link: MSDN ms188396
Link: http://www.queryprocessor.com/ce_join_base_containment_assumption
Link: https://connect.microsoft.com/SQLServer/feedback/details/772232/make-optimizer-estimations-more-accurate-by-using-metadata
Scope: global and session and query

Trace Flag: 2309
Function: In SQL 2014, enables output from a 3rd parameter for DBCC SHOW_STATISTICS such that the partial statistics histogram (for just one partition) is shown.
Link: https://sqlperformance.com/2015/05/sql-statistics/incremental-statistics-are-not-used-by-the-query-optimizer
Link: http://blog.dbi-services.com/sql-server-2014-new-incremental-statistics

Trace Flag: 2312
Function: Enables you to set the query optimizer cardinality estimation model to the SQL Server 2014 through SQL Server 2016 versions, dependent of the compatibility level of the database.
Link: KB2801413
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 2315
Function: Aaron: I stumbled onto this one. Seems to output memory allocations taken during the compilation process (and maybe the plan as well? “PROCHDR”), as well as memory broker states & values at the beginning and end of compilation.
Link: None

Trace Flag: 2318
Function: Aaron: stumbled onto this one as well. I’ve only seen one type of output so far: “Optimization Stage: HEURISTICJOINREORDER”. Maybe useful in combo with other compilation trace flags to see the timing of join reordering?
Link: None

Trace Flag: 2324
Function: Disables Implied Predicates
Link: https://answers.sqlperformance.com/questions/2299/why-not-seek-predicate.html?utm_content=buffer9bed5&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

Trace Flag: 2328
Function: SQL 9+ - Makes cardinality estimates upon resulting selectivity. The reasoning for this is that one or more of the constants may be statement parameters, which would change from one execution of the statement to the next.
Link: https://blogs.msdn.microsoft.com/ianjo/2006/03/28/disabling-constant-constant-comparison-estimation
Link: http://www.queryprocessor.ru/isnumeric_ce_bug_eng

Trace Flag: 2329
Function: Disables “Few Outer Rows” optimization
Link: http://www.queryprocessor.com/few-outer-rows-optimization

Trace Flag: 2330
Function: Query performance decreases when sys.dm_db_index_usage_stats has large number of rows
Link: http://www.brentozar.com/archive/2015/11/trace-flag-2330-who-needs-missing-index-requests/ Link: https://chrisadkin.org/2015/04/14/well-known-and-not-so-well-known-sql-server-tuning-knobs-and-switches/

Trace Flag: 2332
Function: PWhite: “Force DML Request Sort (CUpdUtil::FDemandRowsSortedForPerformance)”
Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx

Trace Flag: 2335
Function: Causes SQL Server to assume a fixed amount of memory is available during query optimization. It does not limit the memory SQL Server grants to execute the query. The memory configured for SQL Server will still be used by data cache, query execution and other consumers.
Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: https://support.microsoft.com/en-us/kb/2413549
Link: MSDN ms188396
Link: http://dba.stackexchange.com/questions/53726/difference-in-execution-plans-on-uat-and-prod-server
Scope: global or session or query

Trace Flag: 2336
Function: Aaron: Another one that I stumbled onto. Appears to tie memory info and cached page likelihoods with costing
Link: None

Trace Flag: 2340
Function: Causes SQL Server not to use a sort operation (batch sort) for optimized nested loop joins when generating a plan. Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.
Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Link: https://blogs.msdn.microsoft.com/psssql/2010/01/11/high-cpu-after-upgrading-to-sql-server-2005-from-2000-due-to-batch-sort
Link: http://www.queryprocessor.com/batch-sort-and-nested-loops
Scope: global or session or query

Trace Flag: 2341
Function: Enables the use of a hash join for joins to column store indexes even when the join clause would normally be removed “during query normalization”.
Link: https://support.microsoft.com/en-us/help/3146123/query-plan-generation-improvement-for-some-columnstore-queries-in-sql-server-2014-or-2016

Trace Flag: 2363
Function: TF Selectivity
Link: Cardinality Estimation Framework 2014 First Look
Link: http://www.queryprocessor.com/ce-process
Link: https://sqlperformance.com/2014/01/sql-plan/cardinality-estimation-for-multiple-predicates

Trace Flag: 2371
Function: Changes the fixed auto update statistics threshold to dynamic auto update statistics threshold.
Note: Beginning with SQL Server 2016 this behavior is controlled by the engine and trace flag 2371 has no effect.
Link: https://support.microsoft.com/en-us/kb/2754171
Link: http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx
Link: MSDN ms188396
Scope: global only

Trace Flag: 2372
Function: Displays memory utilization during the optimization process. Memory for Phases.
Link: More Undocumented Query Optimizer Trace Flags
Link: Cardinality Estimation Framework 2014 First Look

Trace Flag: 2373
Function: Displays memory utilization during the optimization process. Memory for Deriving Properties.
Link: More Undocumented Query Optimizer Trace Flags
Link: Cardinality Estimation Framework 2014 First Look

Trace Flag: 2382
Function: SSC: “SQL 8 -Statistics collected for system tables.”
Link: None

Trace Flag: 2388
Function: Changes the output of DBCC SHOW_STATISTICS. Instead of the normal Header/Vector/Histogram output, instead we get a single row that gives information related to whether the lead column of the stat object is considered to be ascending or not. This TF is primarily helpful in watching the state of a stat object change from “Unknown”, to “Ascending” (and potentially to “Stationary”).
Link: None

Trace Flag: 2389
Function: Enable automatically generated quick statistics for ascending keys (histogram amendment). If trace flag 2389 is set, and a leading statistics column is marked as ascending, then the histogram used to estimate cardinality will be adjusted at query compile time.
Link: KB2801413
Link: http://blogs.msdn.com/b/ianjo/archive/2006/04/24/582227.aspx
Link: http://www.sqlmag.com/article/tsql3/making-the-most-of-automatic-statistics-updating--96767
Link: http://sqlperformance.com/2016/07/sql-statistics/trace-flag-2389-new-cardinality-estimator
Link: https://www.sswug.org/sswugresearch/community/trace-flag-2389-and-the-new-cardinality-estimator/
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 2390
Function: Enable automatically generated quick statistics for ascending or unknown keys (histogram amendment). If trace flag 2390 is set, and a leading statistics column is marked as ascending or unknown, then the histogram used to estimate cardinality will be adjusted at query compile time
Link: http://blogs.msdn.com/b/ianjo/archive/2006/04/24/582227.aspx
Link: KB2801413
Link: http://www.sqlmag.com/article/tsql3/making-the-most-of-automatic-statistics-updating--96767
Link: MSDN ms188396
Link: https://blogs.msdn.microsoft.com/ianjo/2006/04/24/ascending-keys-and-auto-quick-corrected-statistics
Scope: global or session or query

Trace Flag: 2398
Function: Another one I stumbled upon myself...outputs info about “Smart Seek costing”: e.g.: “Smart seek costing (75.2) :: 1.34078e+154 , 1”
Link: None

Trace Flag: 2430
Function: Fixes performance problem when using large numbers of locks
Link: https://support.microsoft.com/en-us/kb/2754301 Link: https://support.microsoft.com/en-us/help/2746341/fix-high-cpu-usage-when-you-execute-an-update-statement-that-includes-a-where-current-of-cursor-clause-in-sql-server-2008

Trace Flag: 2440
Function: SQL 10 - Parallel query execution strategy on partitioned tables. SQL 9 used single thread per partition parallel query execution strategy. In SQL 10, multiple threads can be allocated to a single partition by turning on this flag.
Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dc010af9-afa0-4c87-937c-4343b4e1119a/trace-flag-2440

Trace Flag: 2453
Function: Allow a table variable to trigger recompile when enough number of rows are changed with may allow the query optimizer to choose a more efficient plan.
Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: http://sqlperformance.com/2014/06/t-sql-queries/table-variable-perf-fix
Link: https://support.microsoft.com/en-us/kb/2952444
Link: MSDN ms188396
Link: https://www.brentozar.com/archive/2017/02/using-trace-flag-2453-improve-table-variable-performance
Scope: global or session or query

Trace Flag: 2456
Function: Relieves RESOURCE_SEMAPHORE_MUTEX contention, which may be primarily due to a bug in SQL 2005.
Link: None

Trace Flag: 2466
Function: When SQL Server is determining the runtime DOP for a parallel plan, this flag directs it to use logic found in “older versions” (the post doesn’t say which versions) to determine which NUMA node to place the parallel plan on. This older logic relies on a polling mechanism (roughly every 1 second), and can result in race conditions where 2 parallel plans end up on the same node. The newer logic “significantly reduces” the likelihood of this happening.
Link: https://blogs.msdn.microsoft.com/psssql/2013/09/27/how-it-works-maximizing-max-degree-of-parallelism-maxdop

Trace Flag: 2467
Function: “If target MAXDOP target is less than a single node can provide and if trace flag 2467 is enabled attempt to locate least loaded node”
Link: https://blogs.msdn.microsoft.com/psssql/2013/09/27/how-it-works-maximizing-max-degree-of-parallelism-maxdop
Link: https://blogs.msdn.microsoft.com/psssql/2016/03/04/sql-server-parallel-query-placement-decision-logic/?utm_content=buffer547d7&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

Trace Flag: 2468
Function: “Find the next node that can service the DOP request. Unlike full mode, the global, resource manager keeps track of the last node used. Starting from the last position, and moving to the next node, SQL Server checks for query placement opportunities. If a node can’t support the request SQL Server continues advancing nodes and searching.”
Link: https://blogs.msdn.microsoft.com/psssql/2016/03/04/sql-server-parallel-query-placement-decision-logic/?utm_content=buffer547d7&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

Trace Flag: 2470
Function: Fixes performance problem when using AFTER triggers on partitioned tables
Link: https://support.microsoft.com/en-us/kb/2606883

Trace Flag: 2479
Function: When SQL Server is determining the runtime DOP for a parallel plan, this flag directs it to limit the NUMA Node placement for the query to the node that the connection is associated with.
Link: https://blogs.msdn.microsoft.com/psssql/2013/09/27/how-it-works-maximizing-max-degree-of-parallelism-maxdop Link: https://blogs.msdn.microsoft.com/psssql/2016/03/04/sql-server-parallel-query-placement-decision-logic/?utm_content=buffer547d7&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

Trace Flag: 2486
Function: In SQL 2016 (CTP 3.0 at least), enables output for the “query_trace_column_values” Extended Event, allowing the value of output columns from individual plan iterators to be traced.
Link: http://www.queryprocessor.com/query-trace-column-values

Trace Flag: 2505
Function: SQL 7 - Prevents DBCC TRACEON 208, SPID 10 errors from appearing in the error log (Note: DBCC TRACEON(208) just means “SET QUOTED IDENTIFIER ON”)
Link: None

Trace Flag: 2508
Function: Disables parallel non-clustered index checking for DBCC CHECKTABLE
Link: None

Trace Flag: 2509
Function: Used with DBCC CHECKTABLE to see the total count of forward records in a table
Link: None

Trace Flag: 2514
Function: Verbose Merge Replication logging to msmerge_history table for troubleshooting Merger repl performance
Link: http://sqlblog.com/blogs/argenis_fernandez/archive/2012/05/29/ghost-records-backups-and-database-compression-with-a-pinch-of-security-considerations.aspx

Trace Flag: 2520, 2588
Function: Forces DBCC HELP to return syntax of undocumented DBCC statements. If 2520/2588 is not turned on, DBCC HELP will refuse to give you the syntax stating: "No help available for DBCC state ment 'undocumented statement'". Also affects dbcc help ('?')
Link: http://www.sqlskills.com/blogs/paul/dbcc-writepage/

Trace Flag: 2521
Function: SQL 7 SP2 - Facilitates capturing a Sqlservr.exe user-mode crash dump for postmortem analysis
Link: None

Trace Flag: 2528
Function: Disables parallel checking of objects by DBCC CHECKDB, DBCC CHECKFILEGROUP, and DBCC CHECKTABLE. By default, the degree of parallelism is automatically determined by the query processor. The maximum degree of parallelism is configured just like that of parallel queries. For more information, see Configure the max degree of parallelism Server Configuration Option. Parallel DBCC should typically be left enabled. For DBCC CHECKDB, the query processor reevaluates and automatically adjusts parallelism with each table or batch of tables checked. Sometimes, checking may start when the server is almost idle. An administrator who knows that the load will increase before checking is complete may want to manually decrease or disable parallelism. Disabling parallel checking of DBCC can cause DBCC to take much longer to complete and if DBCC is run with the TABLOCK feature enabled and parallelism set off, tables may be locked for longer periods of time.
Link: MSDN ms188396
Link: https://technet.microsoft.com/en-us/library/ms189094.aspx
Link: http://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-how-long-will-checkdb-take-to-run
Scope: global or session

Trace Flag: 2529
Function: Displays memory usage for DBCC commands when used with TF 3604
Link: None

Trace Flag: 2536
Function: Allows you to see inactive records in transaction log using fn_dblog. Similar to trace flag 2537 for older version than SQL Server 2008.
Link: http://www.sqlsoldier.com/wp/sqlserver/day19of31daysofdisasterrecoveryhowmuchlogcanabackuplog

Trace Flag: 2537
Function: Allows you to see inactive records in transaction log using fn_dblog
Link: http://www.sqlsoldier.com/wp/sqlserver/day19of31daysofdisasterrecoveryhowmuchlogcanabackuplog
Link: http://www.sqlskills.com/blogs/paul/finding-out-who-dropped-a-table-using-the-transaction-log

Trace Flag: 2540
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2541
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2542
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps

Trace Flag: 2543
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2544
Function: Produces a full memory dump
Link: http://support.microsoft.com/kb/917825/en-us
Link: https://blogs.msdn.microsoft.com/askjay/2010/02/05/how-can-i-create-a-dump-of-sql-server
Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/13ce4292-b8a7-41fa-a173-645693957d70/sqldumper?forum=sqldisasterrecovery&forum=sqldisasterrecovery

Trace Flag: 2545
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2546
Function: Dumps all threads for SQL Server in the dump file
Link: http://support.microsoft.com/kb/917825/en-us
Link: https://blogs.msdn.microsoft.com/askjay/2010/02/05/how-can-i-create-a-dump-of-sql-server
Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/13ce4292-b8a7-41fa-a173-645693957d70/sqldumper?forum=sqldisasterrecovery&forum=sqldisasterrecovery
Link: https://blogs.msdn.microsoft.com/psssql/2008/09/12/sql-server-2000-2005-2008-recoveryrollback-taking-longer-than-expected

Trace Flag: 2547
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2548
Function: Shrink will run faster with this trace flag if there are LOB pages that need conversion and/or compaction, because that actions will be skipped.
Link: http://blogs.msdn.com/b/psssql/archive/2008/03/28/how-it-works-sql-server-2005-dbcc-shrink-may-take-longer-than-sql-server-2000.aspx

Thanks to: Andrzej Kukula

Trace Flag: 2549
Function: Runs the DBCC CHECKDB command assuming each database file is on a unique disk drive. DBCC CHECKDB command builds an internal list of pages to read per unique disk drive across all database files. This logic determines unique disk drives based on the drive letter of the physical file name of each file.
Note: Do not use this trace flag unless you know that each file is based on a unique physical disk. Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the PHYSICAL_ONLY option, some users may not see any improvement in performance. While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.
Link: http://blogs.msdn.com/b/saponsqlserver/archive/2011/12/22/faster-dbcc-checkdb-released-in-sql-2008-r2-sp1-traceflag-2562-amp-2549.aspx
Link: http://support.microsoft.com/kb/2634571
Link: https://support.microsoft.com/en-us/kb/2732669
Link: MSDN ms188396
Scope: global only

Trace Flag: 2550
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2551
Function: Produces a filtered memory dump
Link: http://support.microsoft.com/kb/917825/en-us
Link: https://connect.microsoft.com/SQLServer/feedback/details/477863/sql-server-is-terminating-because-of-fatal-exception-c0150014

Trace Flag: 2552
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2553
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2554
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2555
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2556
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2557
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2558
Function: Disables integration between CHECKDB and Watson
Link: http://support.microsoft.com/kb/917825/en-us
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps

Trace Flag: 2559
Function: Unknown, but related to controlling the contents of a memory dump
Link: http://support.microsoft.com/kb/917825/en-us

Trace Flag: 2562
Function: Runs the DBCC CHECKDB command in a single "batch" regardless of the number of indexes in the database. By default, the DBCC CHECKDB command tries to minimize tempdb resources by limiting the number of indexes or "facts" that it generates by using a "batches" concept. This trace flag forces all processing into one batch. One effect of using this trace flag is that the space requirements for tempdb may increase. Tempdb may grow to as much as 5% or more of the user database that is being processed by the DBCC CHECKDB command.
Note: Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the PHYSICAL_ONLY option, some users may not see any improvement in performance. While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.
Link: http://blogs.msdn.com/b/saponsqlserver/archive/2011/12/22/faster-dbcc-checkdb-released-in-sql-2008-r2-sp1-traceflag-2562-amp-2549.aspx
Link: http://support.microsoft.com/kb/2634571
Link: http://support.microsoft.com/kb/2732669/en-us
Link: MSDN ms188396
Scope: global only

Trace Flag: 2566
Function: Runs the DBCC CHECKDB command without data purity check unless DATA_PURITY option is specified.
Note: Column-value integrity checks are enabled by default and do not require the DATA_PURITY option. For databases upgraded from earlier versions of SQL Server, column-value checks are not enabled by default until DBCC CHECKDB WITH DATA_PURITY has been run error free on the database at least once. After this, DBCC CHECKDB checks column-value integrity by default.
Link: MSDN ms188396
Link: https://sqlperformance.com/2012/11/io-subsystem/minimize-impact-of-checkdb
Link: https://support.microsoft.com/en-us/help/2888996/fix-data-purity-corruption-in-sys.sysbinobjs-table-in-master-database-when-you-log-on-to-sql-server-by-using-the-sa-account-and-then-run-dbcc-checkdb
Scope: global only

Trace Flag: 2701
Function: SQL 6.5 - Sets the @@ERROR system function to 50000 for RAISERROR messages with severity levels of 10 or less. When disabled, sets the @@ERROR system function to 0 for RAISERROR messages with severity levels of 10 or less
Link: None

Trace Flag: 2861
Function: Keep zero cost plans in cache. Tip: Avoid Using Trace Flag 2861 to Cache Zero-Cost Query Plan
Link: None

Trace Flag: 2880, 2881
Function: Both 2880 and 2881 are related to a SQL 2000 hotfix introduced to solve problems where ad-hoc queries would cause the procedure cache to get too big
Link: None

Trace Flag: 3001
Function: Stops sending backup entries into MSDB
Link: https://bytes.com/topic/sql-server/answers/162385-how-do-i-prevent-sql-2000-posting-message-event-viewer-application-log

Trace Flag: 3004
Function: Returns more info about Instant File Initialization. Shows information about backups and file creations use with 3605 to direct to error log.
Link: https://blogs.msdn.microsoft.com/psssql/2008/01/23/how-it-works-what-is-restorebackup-doing/
Link: http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf
Link: https://blogs.msdn.microsoft.com/sql_pfe_blog/2009/12/22/how-and-why-to-enable-instant-file-initialization/

Trace Flag: 3014
Function: Returns more info about backups to the errorlog
Link: http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf
Link: https://blogs.msdn.microsoft.com/psssql/2008/02/06/how-it-works-how-does-sql-server-backup-and-restore-select-transfer-sizes

Trace Flag: 3023
Function: Enables CHECKSUM option as default for BACKUP command
Note: Beginning with SQL Server 2014 this behavior is controlled by setting the backup checksum default configuration option. For more information, see Server Configuration Options (SQL Server). Link: https://support.microsoft.com/en-us/kb/2656988
Link: MSDN ms188396
Scope: global and session

Trace Flag: 3028
Function: Enables a hotfix for a problem encountered when backing up to tape with specific backup options
Link: None

Trace Flag: 3031
Function: SQL 9 - Will turn the NO_LOG and TRUNCATE_ONLY options into checkpoints in all recovery modes
Link: http://www.sqlskills.com/blogs/paul/backup-log-with-no_log-use-abuse-and-undocumented-trace-flags-to-stop-it

Trace Flag: 3034
Function: Overrides the server default, and thus always forces backup compression unless the backup command had the no_compression clause explicitly present.
Link: https://blogs.msdn.microsoft.com/ialonso/2012/02/24/vdi-backups-and-backup-compression-default

Trace Flag: 3035
Function: Overrides the server default to always avoid compression, unless the backup command explicitly uses the compression clause. If both 3034 and 3035 are enabled, 3035 takes precedence
Link: https://blogs.msdn.microsoft.com/ialonso/2012/02/24/vdi-backups-and-backup-compression-default

Trace Flag: 3039
Function: As long as the SQL edition supports backup compression, this will allow VDI backups to be affected by the default compression setting just as non-VDI BACKUP commands are affected.
Link: https://blogs.msdn.microsoft.com/ialonso/2012/02/24/vdi-backups-and-backup-compression-default

Trace Flag: 3042
Function: Bypasses the default backup compression pre-allocation algorithm to allow the backup file to grow only as needed to reach its final size. This trace flag is useful if you need to save on space by allocating only the actual size required for the compressed backup. Using this trace flag might cause a slight performance penalty (a possible increase in the duration of the backup operation). For more information about the pre-allocation algorithm, see Backup Compression (SQL Server).
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/help/2001026/inf-space-requirements-for-backup-devices-in-sql-server
Link: https://blogs.msdn.microsoft.com/psssql/2011/08/11/how-compressed-is-your-backup/
Link: https://technet.microsoft.com/en-us/library/bb964719.aspx
Scope: global only

Trace Flag: 3051
Function: Enables SQL Server Backup to URL logging to a specific error log file.
Link: MSDN ms188396
Link: https://msdn.microsoft.com/en-us/library/jj919149.aspx
Scope: global only

Trace Flag: 3057
Function: Enables functionality after a hotfix that allows a log backup that was taken on a t-logfile hosted on a drive with “Bytes per physical sector”=512 to be restored onto a log file/drive that has “Bytes per physical sector”=4096
Link: https://support.microsoft.com/en-us/help/2987585/restore-log-with-standby-mode-on-an-advanced-format-disk-may-cause-a-9004-error-in-sql-server-2008-r2-or-sql-server-2012

Trace Flag: 3101
Function: Fix performance problems when restoring database with CDC
Link: http://support.microsoft.com/kb/2567366/

Trace Flag: 3104
Function: Causes SQL Server to bypass checking for free space
Link: http://sqlblogcasts.com/blogs/martinbell/archive/2011/07/06/Mount-point-Permission-Issues.aspx Link: http://www.databasejournal.com/features/mssql/article.php/1547551/Troubleshooting-SQL-Server-BackupRestore-Problems.htm

Trace Flag: 3106
Function: Required to move sys databases
Link: None

Trace Flag: 3111
Function: “FIX: Backup or Restore Using Large Transaction Logs May Return Error 3241” Causes LogMgr::ValidateBackedupBlock to be skipped during backup and restore operations, allowing backups of very large T-logs to succeed.
Link: None

Trace Flag: 3117
Function: QL 9 - SQL Server 2005 tries to restore the log files and the data files in a single step which some third-party snapshot backup utilities do not support. Turing on 3117 does things the SQL 8 way multiple-step restore process.
Link: None

Trace Flag: 3205
Function: Disable HW compression for backup to tape drives
Link: MSDN ms188396
Scope: global

Trace Flag: 3207
Function: Fixes SQL 6.5 so that tape drives work correctly with DUMP and LOAD statements
Link: None

Trace Flag: 3210
Function: According to Bob Ward’s PASS 2014 talk on SQL Server IO, prints information about “collisions and wait times” that occur between the various “Asynchronous Disk Pool” threads during BACKUP (what about RESTORE?) operations.
Link: None

Trace Flag: 3212
Function: Prints “Backup stats” to the SQL log
Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/24/why-does-restoring-a-database-needs-tempdb

Trace Flag: 3213
Function: Output buffer info for backups to ERRORLOG
Link: https://blogs.msdn.microsoft.com/psssql/2008/02/06/how-it-works-how-does-sql-server-backup-and-restore-select-transfer-sizes
Link: https://blogs.msdn.microsoft.com/psssql/2008/01/28/how-it-works-sql-server-backup-buffer-exchange-a-vdi-focus/

Trace Flag: 3216
Function: Prints quite a lot of info about RESTORE internals. Only seems to print to the error log (TF 3605 is required).
Link: http://jamessql.blogspot.ru/2013/07/trace-flag-for-backup-and-restore.html

Trace Flag: 3222
Function: Disables the read ahead that is used by the recovery operation during roll forward operations
Link: TECHNET List Of SQL Server Trace Flags

Trace Flag: 3226
Function: By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log. If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic. With this trace flag, you can suppress these log entries. This is useful if you are running frequent log backups and if none of your scripts depend on those entries.
Link: MSDN ms188396
Link: http://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bloating-your-error-logs
Link: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2007/10/30/when-is-too-much-success-a-bad-thing
Scope: global only

Thanks to: @lwiederstein (https://twitter.com/lwiederstein)

Trace Flag: 3422
Function: Log record auditing
Link: http://technet.microsoft.com/en-au/library/cc917726.aspx

Trace Flag: 3231
Function: SQL 8/9 - Will turn the NO_LOG and TRUNCATE_ONLY options into no-ops in FULL/BULK_LOGGED recovery mode, and will clear the log in SIMPLE recovery mode. When set, BACKUP LOG with TRUNCATE_ONLY and BACKUP LOG with NO_LOG do not allow a log backup to run if the database's recovery model is FULL or BULK_LOGGED.
Link: http://www.sqlskills.com/blogs/paul/backup-log-with-no_log-use-abuse-and-undocumented-trace-flags-to-stop-it
Link: http://www.sqlskills.com/blogs/kimberly/understanding-backups-and-log-related-trace-flags-in-sql-server-20002005-and-2008

Trace Flag: 3282
Function: SQL 6.5 - Used after backup restoration fails
Link: https://support.microsoft.com/en-us/kb/215458

Trace Flag: 3400
Function: Prints the recovery timings
Link: https://connect.microsoft.com/SQLServer/feedback/details/392158/recovery-portion-of-sql-2008-restore-takes-much-longer-than-normal-when-restoring-from-sql-2005-backup

Trace Flag: 3408
Function: This forces SQL Server startup to use a single thread when recovering all DBs at SQL Server startup, instead of running through its algorithm for determining how many threads to allocate to DB recovery
Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/08/how-much-is-crash-recovery-parallelized-in-which-order-are-databases-recovered/

Trace Flag: 3412
Function: The KB article refers to SQL 6.5, but it is possible that the TF still prints out info to the SQL error log, so leaving it here for now. KB: “...reports when each transaction is rolled forward or back [examine the error log for progress]. However, you will not see any progress if SQL Server is rolling a large transaction forward or back. Additionally, this trace flag duplicates the sp_configure setting Recovery flags..."
Link: None

Trace Flag: 3422
Function: Cause auditing of transaction log records as they're read (during transaction rollback or log recovery). This is useful because there is no equivalent to page checksums for transaction log records and so no way to detect whether log records are being corrupted e careful with these trace flags - I don't recommend using them unless you are experiencing corruptions that you can't diagnose. Turning them on will cause a big CPU hit because of the extra auditing that's happening.
Link: https://support.microsoft.com/en-us/kb/215458
Link: http://www.sqlskills.com/blogs/paul/how-to-tell-if-the-io-subsystem-is-causing-corruptions

Trace Flag: 3448
Function: Introduced in the KB to fix a race condition leading to a hung database in mirroring failover situations. “ This trace flag forces new connections to keep checking for database state every two seconds instead of waiting for a lock for infinite time. It helps ending the connection tasks faster as the mirroring reac hes the start of the recovery phase and releasing more worker threads to be used by database mirroring.”
Link: https://support.microsoft.com/en-us/help/2970421/fix-the-database-sticks-in-role-configuration-phase-when-you-perform-a-manual-failover-of-a-mirrored-database

Trace Flag: 3499
Function: Provides a workaround for doing a rolling upgrade from SQL 2005 to SQL 2008 with a DB that has a full-text index
Link: None

Trace Flag: 3502
Function: Writes info about checkpoints to tech error log
Link: http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf Link: https://blogs.msdn.microsoft.com/joaol/2008/11/20/sql-server-checkpoint-problems/ Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1530-checkpoint-only-writes-pages-from-committed-transactions/

Trace Flag: 3503
Function: Indicates whether the checkpoint at the end of automatic recovery was skipped for a database (this applies only to read-only databases)
Link: http://www.sql-server-performance.com/2002/traceflags/

Trace Flag: 3504
Function: For internal testing. Will raise a bogus log-out-of-space condition from checkpoint
Link: https://blogs.msdn.microsoft.com/joaol/2008/11/20/sql-server-checkpoint-problems/ Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1530-checkpoint-only-writes-pages-from-committed-transactions/

Trace Flag: 3505
Function: Disables automatic checkpointing
Link: http://support.microsoft.com/kb/815436 Link: http://www.sqlskills.com/blogs/paul/benchmarking-1-tb-table-population-part-2-optimizing-log-block-io-size-and-how-log-io-works/

Trace Flag: 3601
Function: Appears to disable CPU instruction prefetching. The Blog post to the right uses it, in concert with 3603, to enable SQL 2000 to run on a machine with a # of processors that is not a power of 2
Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2009/05/27/info-sql-2000-msde-installation-will-fail-if-you-have-number-of-cpus-on-a-box-which-is-not-in-power-of-2

Trace Flag: 3602
Function: Records all error and warning messages sent to the client
Link: https://support.microsoft.com/en-us/help/199037/how-to-capture-error-messages-that-are-sent-to-clients-from-an-instance-of-sql-server

Trace Flag: 3603
Function: Disables “Simultaneous Multithreading Processor check”. Used in concern with TF 3601 in the blog post to the right to enable SQL 2000 to run on a machine with a # of processors that is not a power of 2
Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2009/05/27/info-sql-2000-msde-installation-will-fail-if-you-have-number-of-cpus-on-a-box-which-is-not-in-power-of-2

Trace Flag: 3604
Function: Enables the output from a large number of trace flags and DBCC commands to be sent back to the client. The Connect issue notes that problems can occur when using 3604 with a query that executes across a linked server. This CSS page points out that 3604 is necessary for DBCC DumpTrigger(‘display’)
Link: http://blogs.msdn.com/b/askjay/archive/2011/01/21/why-do-we-need-trace-flag-3604-for-dbcc-statements.aspx
Link: Internals of the Seven SQL Server Sorts – Part 1
Link: https://connect.microsoft.com/SQLServer/feedback/details/306380/trace-flag-issue-7300-3604

Trace Flag: 3605
Function: Sends a variety of types of information to the SQL Server error log instead of to the user console. Often referenced in KB and blog articles in the context of other trace flags (e.g. 3604).
Link: https://blogs.msdn.microsoft.com/askjay/2011/01/21/why-do-we-need-trace-flag-3604-for-dbcc-statements/

Trace Flag: 3607
Function: Skip recovery on startup
Link: http://sqlkbs.blogspot.se/2008/01/trace-flag.html
Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/24/why-does-restoring-a-database-needs-tempdb/

Trace Flag: 3608
Function: Prevents SQL Server from automatically starting and recovering any database except the master database. If activities that require tempdb are initiated, then model is recovered and tempdb is created. Other databases will be started and recovered when accessed. Some features, such as snapshot isolation and read committed snapshot, might not work. Use for Move System Databases and Move User Databases.
Note: Do not use during normal operation.
Link: MSDN ms188396
Link: Importance of Performing DBCC CHECKDB on all SQL Server Databases
Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/24/why-does-restoring-a-database-needs-tempdb
Scope: global only

Trace Flag: 3609
Function: Recovering all databases, but not clearing tempdb
Link: http://basitaalishan.com/2012/02/20/essential-trace-flags-for-recovery-debugging/
Link: Importance of Performing DBCC CHECKDB on all SQL Server Databases
Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/24/why-does-restoring-a-database-needs-tempdb
Scope: global only

Trace Flag: 3610
Function: SQL 9 - Divide by zero to result in NULL instead of error
Link: None

Trace Flag: 3614
Function: Modifies the order of startup operations so that SQL Server can successfully start up even if many user connections are being attempted during SQL startup
Link: None

Trace Flag: 3625
Function: Limits the amount of information returned to users who are not members of the sysadmin fixed server role, by masking the parameters of some error messages using '******'. This can help prevent disclosure of sensitive information.
Link: MSDN ms188396
Scope: global only

Trace Flag: 3626
Function: Turns on tracking of the CPU data for the sysprocesses table.
Link: None

Trace Flag: 3628
Function: CSS’s mysterious description: “Includes ‘other errors’ in the dump based on a severity.”
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps

Trace Flag: 3629
Function: CSS: A memory dump will “include messages marked to include with this trace flag enabled.”
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps

Trace Flag: 3635
Function: Print diagnostic information. Trace Flag 3635 Diagnostics are written to the console that started it. There are not written to the errorlog, even if 3605 is turned on.
Link: None

Trace Flag: 3640
Function: Eliminates sending DONE_IN_PROC messages to client for each statement in stored procedure. This is similar to the session setting of SET NOCOUNT ON, but when set as a trace flag, every client session is handled this way.
Link: https://blogs.msdn.microsoft.com/selvar/2010/07/13/delete-operation-from-a-reporting-service-2005-report-manager-fails-with-internalcatalogexception-and-throws-watson-mini-dump

Trace Flag: 3654
Function: Apparently increases info found in the sys.dm_os_memory_allocations DMV (which appears to have replaced the DBCC MEMOBJLIST command) Bob Ward also discusses it in his PASS 2013 session, saying that it turns on tracing for all memory allocations done by “Memory Objects” (a specific SQLOS memory term). This flag will have a significant impact on system performance.
Link: https://blogs.msdn.microsoft.com/psssql/2012/11/12/how-can-reference-counting-be-a-leading-memory-scribbler-cause
Link: https://blogs.msdn.microsoft.com/slavao/2005/08/30/talking-points-around-memory-manager-in-sql-server-2005
Link: https://support.microsoft.com/en-us/help/2888658/an-access-violation-occurs-when-the-sys.dm-db-index-physical-stats-function-is-used-in-an-if-exists-statement-in-an-sql-query-in-sql-server-2012

Trace Flag: 3656
Function: Enables resolve of all call stacks in extended events
Link: http://sqlcat.com/sqlcat/b/msdnmirror/archive/2010/05/11/resolving-dtc-related-waits-and-tuning-scalability-of-dtc.aspx
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps
Link: http://www.sqlskills.com/blogs/paul/determine-causes-particular-wait-type

Trace Flag: 3659
Function: Enables logging all errors to error log during server startup
Link: http://spaghettidba.com/2011/05/20/trace-flag-3659/

Trace Flag: 3660
Function: W/o this flag, for DBs that have Auto_Close=true and for DBs on Express Edition, DB recovery is normally deferred until first user access when SQL starts up. This TF forces DB recovery to always run (well, only for DBs that actually need recovery done) at SQL Server startup.
Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/08/how-much-is-crash-recovery-parallelized-in-which-order-are-databases-recovered

Trace Flag: 3663
Function: CSS: “By default [SQL Server] allows system cache involvement [with writing to the SQL Error log] to avoid some of the performance issues you might be suspecting, but you can force it to use FILE_FLAG_WRITE_THROUGH” with TF 3663
Link: http://blogs.msdn.com/b/psssql/archive/2011/01/07/discussion-about-sql-server-i-o.aspx

Trace Flag: 3688
Function: Removes messages to error log about traces started and stopped
Link: http://support.microsoft.com/kb/922578/en-us

Trace Flag: 3689
Function: Logs extended errors to errorlog when network disconnect occurs, turned off by default. Will dump out the socket error code this can sometimes give you a clue as to the root cause.
Link: http://support.microsoft.com/kb/922578/en-us

Trace Flag: 3801
Function: Prohibits use of USE DB statement
Link: None

Trace Flag: 3861
Function: This flag allows the SQL Server DB startup code to move system tables to the primary filegroup. Introduced due to behavior in the SQL 2014 upgrade process, where system tables could be created in a secondary filegroup (if that FG was the default).
Link: https://support.microsoft.com/en-us/help/3003760/fix-cannot-remove-the-secondary-filegroup-after-you-upgrade-the-database-to-sql-server-2014

Trace Flag: 3913
Function: SQL 7/8 - SQL Server does not update the rowcnt column of the sysindexes system table until the transaction is committed. When turned on the optimizer gets row count information from in-memory metadata that is saved to sysindexes system table when the transaction commits.
Link: None

Trace Flag: 3917
Function: According to Bob Ward’s PASS 2014 SQL Server IO talk, enables trace output (3605 is required) for the Eager Write functionality that is used with bulk logged operations (such as SELECT INTO)
Link: None

Trace Flag: 3923
Function: Let SQL Server throw an exception to the application when the 3303 warning message is raised
Link: https://support.microsoft.com/kb/3014867/en-us

Trace Flag: 3924
Function: Enables a fix where “XA” transactions started within a JDBC-connected Java app are not closed properly and stay open indefinitely.
Link: https://support.microsoft.com/en-us/help/3145492/fix-xa-transactions-aren-t-cleaned-when-you-exit-a-java-application-in-an-instance-of-sql-server

Trace Flag: 3940
Function: According to Bob Ward’s PASS 2014 SQL Server IO talk, forces the Eager Write functionality to throttle at 1024 outstanding eager writes.
Link: None

Trace Flag: 4001
Function: Very verbose logging of each login attempt to the error log. Includes tons of information
Link: None

Trace Flag: 4010
Function: Allows only shared memory connections to the SQL Server. Meaning, you will only be able to connect from the server machine itself. Client connections over TCP/IP or named pipes will not happen.
Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2011/05/11/inf-hey-my-sql-server-service-is-not-starting-what-do-i-do Link: https://blogs.msdn.microsoft.com/psssql/2008/09/05/sql-server-2005-setup-fails-in-wow-x86-on-computer-with-more-than-32-cpus

Trace Flag: 4013
Function: Log each new connection the error log
Link: http://sqlkbs.blogspot.se/2008/01/trace-flag.html

Trace Flag: 4020
Function: Boot without recover
Link: None

Trace Flag: 4022
Function: Directs the SQL instance to ignore stored procedures that have been configured as “auto-start” procedures. Their auto-start configuration is not affected, so the next time the instance is started w/o this flag they will return to their normal behavior.
Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2011/05/11/inf-hey-my-sql-server-service-is-not-starting-what-do-i-do/

Trace Flag: 4029
Function: Logs extended errors to errorlog when network disconnect occurs, turned off by default. Will dump out the socket error code this can sometimes give you a clue as to the root cause.
Link: https://blogs.msdn.microsoft.com/sql_protocols/2005/12/19/vss-sql-server-does-not-exist-or-access-denied

Trace Flag: 4030
Function: Prints both a byte and ASCII representation of the receive buffer. Used when you want to see what queries a client is sending to SQL Server. You can use this trace flag if you experience a protection violation and want to determine which statement caused it. Typically, you can set this flag globally or use SQL Server Enterprise Manager. You can also use DBCC INPUTBUFFER.
Link: None

Trace Flag: 4031
Function: Prints both a byte and ASCII representation of the send buffers (what SQL Server sends back to the client). You can also use DBCC OUTPUTBUFFER.
Link: None

Trace Flag: 4032
Function: Traces the SQL commands coming in from the client. When enabled with 3605 it will direct those all to the error log.
Link: https://support.microsoft.com/en-us/help/199037/how-to-capture-error-messages-that-are-sent-to-clients-from-an-instance-of-sql-server
Link: https://support.microsoft.com/en-us/help/140895/inf-diagnostic-tips-for-the-microsoft-sql-server-odbc-driver

Trace Flag: 4044
Function: SA account can be unlocked by rebooting server with trace flag. If sa (or sso_role) password is lost, add this to your RUN_serverfile. This will generate new password when server started.
Link: None

Trace Flag: 4052
Function: SQL 9+ Prints TDS packets sent to the client (output) to console. Startup only.
Link: None

Trace Flag: 4055
Function: SQL 9+ Prints TDS packets received from the client to console. Startup only.
Link: None

Trace Flag: 4101
Function: “FIX: Reorder outer joins with filter criteria before non-selective joins and outer joins” Enabling this flag may increase the chance that selective filter criteria on an OUTER JOIN will influence the OJ earlier in the plan, rather than the more typical behavior of INNER JOINs being prioritized before OJs. Note that 4101 is also required to enable KB942444.
Link: https://support.microsoft.com/en-us/help/318530/fix-reorder-outer-joins-with-filter-criteria-before-non-selective-joins-and-outer-joins

Trace Flag: 4102
Function: SQL 9 - Query performance is slow if the execution plan of the query contains semi join operators Typically, semi join operators are generated when the query contains the IN keyword or the EXISTS keyword. Enable flag 4102 and 4118 to overcome this.
Link: https://support.microsoft.com/en-us/help/946020/fix-error-message-when-you-run-a-complex-query-after-you-install-cumulative-update-3-or-cumulative-update-4-for-sql-server-2005-service-pack-2-the-query-processor-ran-out-of-internal-resources-and-could-not-produce-a-query-plan

Trace Flag: 4103
Function: “FIX: A query may take longer to run in SQL Server 2005 SP1 than it takes to run in the original release version of SQL Server 2005 or in SQL Server 2000” Applies particularly to queries that contain subqueries with “many column joins”.
Link: None

Trace Flag: 4104
Function: SQL 9 - Overestimating cardinality of JOIN operator. When additional join predicates are involved, this problem may increase the estimated cost of the JOIN operator to the point where the query optimizer chooses a different join order. When the query optimizer chooses a different join order, SQL 9 system performance may be slow.
Link: None

Trace Flag: 4105
Function: “FIX: The SQL Server 2005 query optimizer may incorrectly estimate the cardinality for a query that has a predicate that contains an index union alternative”
Link: None

Trace Flag: 4106
Function: “FIX: A query may take a long time to compile when the query contains several JOIN clauses against a SQL Server 2005 database”
Link: None

Trace Flag: 4107
Function: SQL 9 - When you run a query that references a partitioned table, query performance may decrease
Link: None

Trace Flag: 4108
Function: “FIX: The query performance is very slow when you use a fast forward-only cursor to run a query in SQL Server 2005”
Link: None

Trace Flag: 4109
Function: “FIX: Error message when you run a query that uses a fast forward-only cursor in SQL Server 2005: "Query processor could not produce a query plan because of the hints defined in this query”
Link: https://support.microsoft.com/en-us/help/926773/fix-error-message-when-you-run-a-query-that-uses-a-fast-forward-only-cursor-in-sql-server-2005-query-processor-could-not-produce-a-query-plan-because-of-the-hints-defined-in-this-query

Trace Flag: 4110
Function: “FIX: The query performance is slow when you run a query that uses a user-defined scalar function against an instance of SQL Server 2005”
Link: None

Trace Flag: 4111
Function: Fixes a cardinality estimate issue with an unnamed builtin function. The KB article title shows that the issue was initially hit due to timeouts with the Replication Merge agent, but the problem was ultimately a poor query plan.
Link: None

Trace Flag: 4112
Function: Enables a fix for a problem that occurs when a linked server from 2005 or 2008 targets SQL 2000: “This problem occurs because SQL Server 2005 generates an execution plan that has a remote query. SQL Server 2005 must execute the remote query against SQL Server 2000 to retrieve the required data. SQL Server 2000 cannot handle the remote query. Therefore, error 107 occurs in SQL Server 2000. Then, error 107 is propagated back to SQL Server 2005. Therefore, error 107 occurs in SQL Server 2005, and error 8180 occurs in SQL Server 2005.”
Link: https://support.microsoft.com/en-us/help/936223/fix-error-messages-when-you-run-a-query-against-a-linked-server-that-you-create-in-sql-server-2005-statement-s-could-not-be-prepared-and-the-column-prefix-column-prefix-name-does-not-match-with-a-table-name-or-alias-name-...

Trace Flag: 4115
Function: “FIX: A query that you run by using a FORWARD_ONLY cursor takes alonger time to run in Microsoft SQL Server 2005 than in SQL Server 2000 ”The fix apparently increases the likelihood that a certain type of cursor will use an index seek (as it did in SQL 2000) rather than regressing to a scan for each Fetch. The notes also contain some interesting info about sp_cursoropen
Link: None

Trace Flag: 4116
Function: SQL 9 - Query runs slowly when using joins between a local and a remote table
Link: None

Trace Flag: 4117
Function: “FIX: A blocking issue occurs when you update rows in a table in SQL Server 2005...[A] problem occurs because the positioned update in a transaction performs a table scan on all involved tables. This behavior causes many update locks to be generated on many rows in the table. Additionally, SQL Server tries to add an update lock on the ow that has already been granted an exclusive lock by another transaction. Therefore, a blocking issue occurs.”
Link: None

Trace Flag: 4119
Function: “FIX: The query performance is slower when you run the query in SQL Server 2005 than when you run the query in SQL Server 2000” The example given in the KB article indicates that selective LIKE predicates may not be considered fully when less-selective “comparison” (e.g. =, >, etc) predicates are done on the same parameter (or variable?) value as the LIKE predicate.
Link: None

Trace Flag: 4120
Function: “FIX: Error message when you perform an update operation by using a cursor in SQL Server 2005: Transaction (Process ID ) was deadlocked on lock resources with another process and has been chosen as the deadlock victim” This issue is apparently due to deadlock issues related to upgrading a U lock to an X lock.
Link: https://support.microsoft.com/en-us/help/953948/fix-error-message-when-you-perform-an-update-operation-by-using-a-cursor-in-sql-server-2005-transaction-process-id-spid-was-deadlocked-on-lock-resources-with-another-process-and-has-been-chosen-as-the-deadlock-victim

Trace Flag: 4121
Function: SQL 9 - Query that involves an outer join operation runs very slowly. However, if you use the FORCE ORDER query hint in the query, the query runs much faster. Additionally, the execution plan of the query contains the following text in the Warnings column: NO JOIN PREDICATE.
Link: None

Trace Flag: 4123
Function: Query that has many outer joins takes a long time to compile in SQL Server 2005
Link: None

Trace Flag: 4124
Function: “FIX: A query performance issue occurs when you run a query against a column of the bigint data type in SQL Server 2005... If the All Density column [of SHOW_STATISTICS] displays incorrect values of 1, you are encountering this problem”
Link: None

Trace Flag: 4125
Function: SQL 9 - Query may take more time to finish if using an inner join to join a derived table that uses DISTINCT keyword
Link: None

Trace Flag: 4126
Function: “FIX: The synchronization process is slow, and the CPU usage is high on the computer that is configured as the Distributor in SQL Server 2005” The problem manifested as a replication performance issue, but the following phrase found in the KB article indicates that it is a query processor issue: “the query that performs poorly shows that a join predicate is not pushed down to a Clustered Index Seek operator.”
Link: https://support.microsoft.com/en-us/help/959013/fix-the-synchronization-process-is-slow,-and-the-cpu-usage-is-high-on-the-computer-that-is-configured-as-the-distributor-in-sql-server-2005

Trace Flag: 4127
Function: SQL 9 - Compilation time of some queries is very long in an x64-based version. Basically its more than execution time because more memory allocations are necessary in the compilation process.
Link: Note

Trace Flag: 4128
Function: “FIX: When you update rows by using a cursor in SQL Server 2005, the update may take a long time to finish”
Link: https://support.microsoft.com/en-us/help/957872/fix-when-you-update-rows-by-using-a-cursor-in-sql-server-2008,-the-update-may-take-a-long-time-to-finish

Trace Flag: 4129
Function: “FIX: The values of the datetime column are not same for the rows that are copied when you copy data to a table by using the GETDATE() function in Microsoft SQL Server 2005”
Link: None

Trace Flag: 4130
Function: XML performance fix
Link: None

Trace Flag: 4131
Function: “FIX: When you run a query that contains a JOIN operation in SQL Server 2005 or SQL Server 2008, and the ON clause of the JOIN operator contains a LIKE predicate, the query runs slower than in SQL Server 2000”
Link: None

Trace Flag: 4133
Function: “FIX: The size of the SQL Server 2005 error log file or of the SQL Server 2008 error log file grows very quickly when query notifications are created and destroyed in a high ratio” & “FIX: The restore operation takes a long time when you restore a database that has query notification enabled in SQL Server 2005 or in SQL Server 2008”
Link: https://support.microsoft.com/en-us/help/958006/fix-the-size-of-the-sql-server-2005-error-log-file-or-of-the-sql-server-2008-error-log-file-grows-very-quickly-when-query-notifications-are-created-and-destroyed-in-a-high-ratio

Trace Flag: 4134
Function: Bugfix for error: parallel query returning different results every time
Link: http://support.microsoft.com/kb/2546901
Link: http://sql-sasquatch.blogspot.se/2014/04/whaddayaknow-bout-sqlserver-trace-flag.html

Trace Flag: 4135
Function: Bugfix for error inserting to temp table
Link: http://support.microsoft.com/kb/960770
Link: https://connect.microsoft.com/SQLServer/feedback/details/541352/tempdb-errors-during-statistics-auto-update

Trace Flag: 4136
Function: Disables parameter sniffing unless OPTION(RECOMPILE), WITH RECOMPILE or OPTIMIZE FOR value is used. To accomplish this at the database level, see ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL). To accomplish this at the query level, add the OPTIMIZE FOR UNKNOWN query hint. Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: http://blogs.msdn.com/b/axinthefield/archive/2010/11/04/sql-server-trace-flags-for-dynamics-ax.aspx
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 4137
Function: Causes SQL Server to generate a plan using minimum selectivity when estimating AND predicates for filters to account for correlation, under the query optimizer cardinality estimation model of SQL Server 2012 and earlier versions
Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: http://support.microsoft.com/kb/2658214
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 4138
Function: Causes SQL Server to generate a plan that does not use row goal adjustments with queries that contain TOP, OPTION (FAST N), IN, or EXISTS keywords
Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: http://support.microsoft.com/kb/2667211
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Link: https://answers.sqlperformance.com/questions/1609/trying-to-figure-out-how-to-resolve-the-data-skew.html
Link: http://dba.stackexchange.com/questions/55198/huge-slowdown-to-sql-server-query-on-adding-wildcard-or-top
Scope: global or session or query

Trace Flag: 4139
Function: Enable automatically generated quick statistics (histogram amendment) regardless of key column status. If trace flag 4139 is set, regardless of the leading statistics column status (ascending, descending, or stationary), the histogram used to estimate cardinality will be adjusted at query compile time
Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link : https://support.microsoft.com/en-us/kb/2952101
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 4199
Function: Controls query optimizer changes released in SQL Server Cumulative Updates and Service Packs. Starting with SQL Server 2016, trace flag 4199 changes that are made to previous releases of SQL Server will become enabled under database compatibility level 130 without trace flag 4199 enabled
To enable this at the database level, see ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL).
Note: Starting with SQL Server 2016, customers are advised to remove trace flag 4199 after they migrate their databases to the latest compatibility level because trace flag 4199 will be reused for future query optimizer changes that may not apply to your application and could cause unexpected plan performance changes on a production system. This means that different trace flag 4199 changes are enabled for each compatibility level that is supported in a given product release. Link: https://support.microsoft.com/en-us/kb/974006
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/help/974006/sql-server-query-optimizer-hotfix-trace-flag-4199-servicing-model
Scope: global or session

Trace Flag: 4606
Function: Over comes SA password by startup. Disables password policy check during server startup.
Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2011/05/11/inf-hey-my-sql-server-service-is-not-starting-what-do-i-do
Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2008/07/31/upgrade-of-sql-server-2000-instance-to-sql-server-2005-fails-with-error-similar-to-enforce-password-policy

Trace Flag: 4610
Function: When you use trace flag 4618 together with trace flag 4610, the number of entries in the cache store is limited to 8,192. When the limit is reached, SQL 2005 removes some entries from the TokenAndPermUserStore cache store.
Link: https://support.microsoft.com/en-us/kb/959823
Link: MSDN ms188396
Link: https://blogs.msdn.microsoft.com/psssql/2008/06/16/query-performance-issues-associated-with-a-large-sized-security-cache/
Scope: global only

Trace Flag: 4612
Function: Disable the ring buffer logging - no new entries will be made into the ring buffer
Link: http://blogs.msdn.com/b/lcris/archive/2007/02/19/sql-server-2005-some-new-security-features-in-sp2.aspx

Trace Flag: 4613
Function: Generate a minidump file whenever an entry is logged into the ring buffer
Link: http://blogs.msdn.com/b/lcris/archive/2007/02/19/sql-server-2005-some-new-security-features-in-sp2.aspx

Trace Flag: 4614
Function: Enables SQL Server authenticated logins that use Windows domain password policy enforcement to log on to the instance even though the SQL Server service account is locked out or disabled on the Windows domain controller.
Link: https://support.microsoft.com/en-us/kb/925744

Trace Flag: 4616
Function: Makes server-level metadata visible to application roles. In SQL Server, an application role cannot access metadata outside its own database because application roles are not associated with a server-level principal. This is a change of behavior from earlier versions of SQL Server. Setting this global flag disables the new restrictions, and allows for application roles to access server-level metadata.
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/help/906549/you-may-receive-a-permission-denied-error-message-when-an-application-role-based-application-tries-to-select-records-from-any-one-of-the-system-tables-in-a-sql-server-2005-master-database
Scope: global only

Trace Flag: 4618
Function: Limits number of entries per user cache store to 1024. It may incur a small CPU overhead as when removing old cache entries when new entries are inserted. It performs this action to limit the size of the cache store growth. However, the CPU overhead is spread over time. When used together with trace flag 4610 increases the number of entries in the TokenAndPermUserStore cache store to 8192
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/kb/933564
Link: https://support.microsoft.com/en-us/help/959823/how-to-customize-the-quota-for-the-tokenandpermuserstore-cache-store-in-sql-server-2005-service-pack-3
Scope: global only

Trace Flag: 4620
Function: According to the Connect item, causes permission checking to be done on a global cache instead of the per-user caches that were introduced in SQL 2008. The thread includes some interesting information on the cache stores, especially as they relate to TokenPermAndUserStore.
Link: https://connect.microsoft.com/SQLServer/feedback/details/467661/sql-server-2008-has-incorrect-cache-names-in-sys-dm-os-memory-cache-counters

Trace Flag: 4621
Function: SQL 9 – After 4610 & 4618 you can still customize the quota for TokenAndPermUserStore cache store that is based on the current workload
Link: https://support.microsoft.com/en-us/kb/959823

Trace Flag: 5101
Function: Forces all I/O requests to go through engine 0. This removes the contention between processors but could create a bottleneck if engine 0 becomes busy with non-I/O tasks.
Link: http://dba.fyicenter.com/Interview-Questions/SYBASE/What_is_Trace_Flag_Definitions_in_Sybase.html#1.3.4#1.3.4

Trace Flag: 5102
Function: Prevents engine 0 from running any non-affinitied tasks.
Link: http://dba.fyicenter.com/Interview-Questions/SYBASE/What_is_Trace_Flag_Definitions_in_Sybase.html#1.3.4#1.3.4

Trace Flag: 5302
Function: Alters default behavior of select…INTO (and other processes) that lock system tables for the duration of the transaction. This trace flag disables such locking during an implicit transaction.
Link: https://support.microsoft.com/en-us/help/153096/fix-sql-server-6.5-service-pack-1-fixlist

Trace Flag: 6498
Function: Enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available. It is based on the 80 percentage of SQL Server Target Memory, and it allows for one large query compilation per 25 gigabytes (GB) of memory.
Note: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 6498 has no effect.
Link: https://support.microsoft.com/en-us/kb/3024815
Link: MSDN ms188396
Link: http://blogs.msdn.com/b/sql_server_team/archive/2015/10/09/query-compile-big-gateway-policy-changes-in-sql-server.aspx
Scope: global only

Trace Flag: 6527
Function: Disables generation of a memory dump on the first occurrence of an out-of-memory exception in CLR integration. By default, SQL Server generates a small memory dump on the first occurrence of an out-of-memory exception in the CLR. The behaviour of the trace flag is as follows: If this is used as a startup trace flag, a memory dump is never generated. However, a memory dump may be generated if other trace flags are used. If this trace flag is enabled on a running server, a memory dump will not be automatically generated from that point on. However, if a memory dump has already been generated due to an out-of-memory exception in the CLR, this trace flag will have no effect.
Link: MSDN ms188396
Scope: global

Trace Flag: 6530
Function: Enables a hotfix for “ FIX: Slow performance in SQL Server 2012 or SQL Server 2014 when you build an index on a spatial data type of a large table”
Link: https://blogs.msdn.microsoft.com/psssql/2013/11/19/spatial-indexing-from-4-days-to-4-hours Link: https://support.microsoft.com/en-us/help/2896720/fix-slow-performance-in-sql-server-2012-or-sql-server-2014-when-you-build-an-index-on-a-spatial-data-type-of-a-large-table

Trace Flag: 6531
Function: Enables adjustment in the SQLOS scheduling layer to handle queries that issue many short-duration calls to spatial data (which is implemented via CLR functions): “ This fix introduces the trace flag 6531 to indicate to the SQLOS hosting layer that the spatial data type should avoid preemptive protections. This can reduce the CPU consumption and improve the overall performance for spatial activities. Only use this trace flag if the individual, spatial method invocations (per row and column) take less than ~4ms. Longer invocations without preemptive protection could lead to scheduler concurrency issues and SQLCLR punishment messages logged to the error log.”
Link: https://support.microsoft.com/en-us/help/3005300/fix-high-cpu-consumption-when-you-use-spatial-data-type-and-associated-methods-in-sql-server-2012-or-sql-server-2014

Trace Flag: 6532
Function: Enables performance improvement of query operations with spatial data types in SQL Server 2012 and SQL Server 2014. The performance gain will vary, depending on the configuration, the types of queries, and the objects.
Link: KB3107399
Link: MSDN ms188396
Scope: global and session

Trace Flag: 6533
Function: Enables performance improvement of query operations with spatial data types in SQL Server 2012 and SQL Server 2014. The performance gain will vary, depending on the configuration, the types of queries, and the objects.
Link: KB3107399
Link: MSDN ms188396
Scope: global and session

Trace Flag: 6534
Function: Enables performance improvement of query operations with spatial data types in SQL Server 2012, SQL Server 2014 and SQL Server 2016. The performance gain will vary, depending on the configuration, the types of queries, and the objects.
Link: https://support.microsoft.com/en-us/kb/3054180
Link: KB3107399
Link: https://blogs.msdn.microsoft.com/bobsql/2016/06/03/sql-2016-it-just-runs-faster-native-spatial-implementations/
Link: MSDN ms188396
Scope: global and session

Trace Flag: 7103
Function: Disable table lock promotion for text columns
Link: https://support.microsoft.com/en-us/kb/230044

Trace Flag: 7300
Function: Outputs extra info about linked server errors
Link: http://support.microsoft.com/kb/314530
Link: https://support.microsoft.com/en-us/help/280106/how-to-set-up-and-troubleshoot-a-linked-server-to-an-oracle-database-in-sql-server
Link: https://support.microsoft.com/en-us/help/280102/how-to-set-up-a-linked-server-to-a-sybase-database-server-and-troubleshoot-problems-that-may-occur
Link: https://connect.microsoft.com/SQLServer/feedback/details/306380/trace-flag-issue-7300-3604

Trace Flag: 7301
Function: Fixes a problem in SQL 6.5 where SELECT INTO queries with text/image types were not bulk-logged.
Link: None

Trace Flag: 7311
Function: Offers a new alternative to handling the tricky problem of converting Oracle NUMBER types (across OLEDB linked server queries) with unknown precision/scale to a valid SQL Server data type, by treating all such types as NUMERIC(38,10).
Link: https://support.microsoft.com/en-us/help/3051993/fix-the-value-of-number-type-is-truncated-when-you-select-data-from-an-oracle-linked-server-by-using-ole-db-provider

Trace Flag: 7314
Function: Forces NUMBER values with unknown precision/scale to be treated as double values with OLE DB provider
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/kb/3051993
Scope: global and session

Trace Flag: 7352
Function: Show the optimizer output and the post-optimization rewrite in action
Link: Internals of the Seven SQL Server Sorts – Part 1
Link: http://sqlblog.com/blogs/paul_white/archive/2013/08/31/sql-server-internals-nested-loops-prefetching.aspx
Link: http://www.queryprocessor.com/batch-sort-and-nested-loops

Trace Flag: 7357
Function: Outputs info re: hashing operators, including role reversal, recursion levels, whether the Unique Hash optimization could be used, info about the hash-related bitmap, etc. Dima’s article is a must-read. For parallel query plans, 7357 does NOT send output to the console window. However, output to the SQL Server error log can be enabled by enabling 3605.
Link: http://www.queryprocessor.com/hash-join-execution-internals
Link: http://sqlblog.com/blogs/paul_white/archive/2012/05/01/query-optimizer-deep-dive-part-4.aspx

Trace Flag: 7359
Function: Disables the bitmap associated with hash matching. This bitmap is used for “bit-vector filtering” and can reduce the amount of data written to TempDB during hash spills.
Link: www.queryprocessor.com/hash-join-execution-internals

Trace Flag: 7470
Function: Fixes a problem where under certain (unknown) conditions, a sort spill occurs for large sorts
Link: https://support.microsoft.com/en-us/help/3088480/fix-sort-operator-spills-to-tempdb-in-sql-server-2012-or-sql-server-2014-when-estimated-number-of-rows-and-row-size-are-correct

Trace Flag: 7412
Function: Enables the lightweight query execution statistics profiling infrastructure
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/kb/3170113
Scope: global only

Trace Flag: 7470
Function: Fix for sort operator spills to tempdb in SQL Server 2012 or SQL Server 2014 when estimated number of rows and row size are correct
Link: https://support.microsoft.com/en-us/kb/3088480

Trace Flag: 7471
Function: Running multiple UPDATE STATISTICS for different statistics on a single table concurrently
Link: https://support.microsoft.com/en-us/kb/3156157
Link: http://sqlperformance.com/2016/05/sql-performance/parallel-rebuilds

Trace Flag: 7497
Function: Behavior and intended purpose unknown, but in this post Paul White uses it in concert with 7498 to disable “optimized bitmaps”.
Link: https://sqlperformance.com/2015/11/sql-plan/hash-joins-on-nullable-columns

Trace Flag: 7498
Function: Behavior and intended purpose unknown, but in this post Paul White uses it in concert with 7497 to disable “optimized bitmaps”.
Link: https://sqlperformance.com/2015/11/sql-plan/hash-joins-on-nullable-columns

Trace Flag: 7501
Function: Dynamic cursors are used by default on forward-only cursors. Dynamic cursors are faster than in earlier versions and no longer require unique indexes. This flag disables the dynamic cursor enhancements and reverts to version 6.0 behavior.
Link: None

Trace Flag: 7502
Function: Disable cursor plan caching for extended stored procedures
Link: http://basitaalishan.com/2012/02/20/essential-trace-flags-for-recovery-debugging/

Trace Flag: 7505
Function: Enables version 6.x handling of return codes when calling dbcursorfetchex and the resulting cursor position follows the end of the cursor result set
Link: None

Trace Flag: 7525
Function: SQL 8 - Reverts to ver 7 behavior of closing nonstatic cursors regardless of the SET CURSOR_CLOSE_ON_COMMIT state
Link: None

Trace Flag: 7601, 7603, 7604, 7605
Function: Helps in gathering more information in full text search by turning on full text tracing which gathers information on indexing process using the error log. Also 7603, 7604, 7605 trace flags.
Link: https://connect.microsoft.com/SQLServer/feedback/details/526343/looking-for-documentation-on-trace-flags-7601-7603-7604-and-7605

Trace Flag: 7608
Function: Performance fix for slow full text population with a composite clustered index
Link: None

Trace Flag: 7613
Function: SQL 9 - Search results are missing when performing a full-text search operation on Win SharePoint Services 2.0 site after upgrading
Link: None

Trace Flag: 7614
Function: SQL 9 - Full-text index population for the indexed view is very slow
Link: None

Trace Flag: 7646
Function: SQL 10 - Avoids blocking when using full text indexing. An issue we experienced that full text can be slow when there is a high number of updates to the index and is caused by blocking on the docidfilter internal table.
Link: None

Trace Flag: 7806
Function: SQL 9 - Enables a dedicated administrator connection on SQL Express, DAC resources are not reserved by default
Link: MSDN ms188396
Link: https://msdn.microsoft.com/en-us/library/ms189595.aspx
Link: https://sqlperformance.com/2012/08/sql-memory/test-your-dac-connection
Scope: global only

Trace Flag: 7826
Function: Disable Connectivity ring buffer
Link: http://blogs.msdn.com/b/sql_protocols/archive/2008/05/20/connectivity-troubleshooting-in-sql-server-2008-with-the-connectivity-ring-buffer.aspx

Trace Flag: 7827
Function: Record connection closure info in ring buffer
Link: http://blogs.msdn.com/b/sql_protocols/archive/2008/05/20/connectivity-troubleshooting-in-sql-server-2008-with-the-connectivity-ring-buffer.aspx
Link: https://connect.microsoft.com/SQLServer/feedback/details/518158/-packet-error-a-fatal-error-occurred-while-reading-the-input-stream-from-the-network

Trace Flag: 7833
Function: SQL 2012 SP2 CU8 introduced a fix for a “silent error” condition in the sqlcmd tool. The CU also included this flag to allow customers to revert to pre-CU fix behavior.
Link: https://support.microsoft.com/en-us/help/3082877/fix-no-error-is-prompted-when-connection-is-terminated-in-sqlcmd

Trace Flag: 8001
Function: Khen2005, p2: “For SQL Server 2005, the SQL Server product team opted not to include some wait types that fall under one of the following three categories:

  • Wait types that are never used in SQL Server 2005; note that some wait types not excluded are also never used.
  • Wait types that can occur only at times when they do not affect user activity, such as during initial server startup and shutdown, and are not visible to users.
  • Wait types that are innocuous but have caused concern among users because of their high occurrence or duration The complete list of wait types is available by enabling trace flag 8001. The only effect of this trace flag is to force sys.dm_os_wait_stats to display all wait types.”
    Link: None

Trace Flag: 8002
Function: Changes CPU Affinity behaviour
Link: https://blogs.msdn.microsoft.com/psssql/2011/11/11/sql-server-clarifying-the-numa-configuration-information

Trace Flag: 8004
Function: SQL server to create a mini-dump once you enable 2551 and a out of memory condition is hit
Link: https://connect.microsoft.com/SQLServer/feedback/details/342691/not-enough-memory-was-available-for-trace-error-when-attempting-to-profile-sql-2008

Trace Flag: 8008
Undocumented trace flag
Function: Force the scheduler hint to be ignored. Always assign to the scheduler with the least load (pool based on SQL 2012 EE SKU or Load Factor for previous versions and SKUs.)
Link: How It Works: SQL Server 2012 Database Engine Task Scheduling Link: https://blogs.msdn.microsoft.com/psssql/2013/08/13/how-it-works-sql-server-2012-database-engine-task-scheduling Link: http://www.stillhq.com/sqldownunder/archives/msg05089.html

Trace Flag: 8009
Undocumented trace flag
Function: Enables the “idle state behavior” (see IO Basics, Chapter 2 document) that a SQL instance can enter under certain conditions.
Link: https://technet.microsoft.com/en-us/library/cc917726.aspx

Trace Flag: 8010
Function: Disables the “idle state” behavior that a SQL instance can enter (see TF 8009). Fixes problem that SQL Server services can not be stopped
Link: http://support.microsoft.com/kb/2633271/en-us Link: https://technet.microsoft.com/en-us/library/cc917726.aspx

Trace Flag: 8011
Function: Disable the ring buffer for Resource Monitor
Link: KB920093
Link: MSDN ms188396
Scope: global and session

Trace Flag: 8012
Function: Disable the ring buffer for schedulers
Link: KB920093
Link: MSDN ms188396
Scope: global only

Trace Flag: 8015
Function: Disable auto-detection and NUMA setup
Link: MSDN ms188396
Link: http://sql-sasquatch.blogspot.se/2013/04/startup-trace-flags-i-love.html
Scope: global only

Trace Flag: 8016
Undocumented trace flag
Function: Force load balancing to be ignored. Always assign to the preferred scheduler.
Link: How It Works: SQL Server 2012 Database Engine Task Scheduling

Trace Flag: 8017
Function: Upgrade version conflict
Link: http://social.msdn.microsoft.com/Forums/eu/sqlexpress/thread/dd6fdc16-9d8d-4186-9549-85ba4c322d10
Link: http://connect.microsoft.com/SQLServer/feedback/details/407692/indicateur-de-trace-8017-reported-while-upgrading-from-ssee2005-to-ssee2008 Link: http://dba.stackexchange.com/questions/48580/trace-flag-and-which-need-to-be-turned-off-and-why

Trace Flag: 8018
Function: Disable the exception ring buffer
Link: KB920093
Link: MSDN ms188396
Scope: global only

Trace Flag: 8019
Function: Disable stack collection for the exception ring buffer
Link: KB920093
Link: MSDN ms188396
Scope: global only

Trace Flag: 8020
Function: Disable working set monitoring
Link: KB920093
Link: MSDN ms188396
Scope: global only

Trace Flag: 8021
Function: On some lower end hardware we used to get reported that each CPU has its own NUMA node. This was usually incorrect and when we detected only a single CPU per NODE we would assume NO NUMA. Trace flag 8021 disables this override.
Link: https://blogs.msdn.microsoft.com/psssql/2011/11/11/sql-server-clarifying-the-numa-configuration-information/

Trace Flag: 8022
Function: This flag gives more information about the conditions when a non-yielding scheduler/situation was encountered. The whitepaper linked to on the right gives example output for this flag
Link: None

Trace Flag: 8024
Function: When this TF is on, it affects the mini-dump generation logic for the 1788* errors: "To capture a mini-dump, one of the following checks must also be met. 1. The non-yielding workers CPU utilization must be > 40 percent. 2. The SQL Server process is not starved for overall CPU resource utilization. Additional check #1 is targeted at runaway CPU users. Additional check #2 is targeted at workers with lower utilizations that are probably stuck in an API call or similar activity."
Link: How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888

Trace Flag: 8025
Function: SQL on NUMA normally does most of its allocation on Node 1, because usually Windows and other programs will allocate from Node 0. However, if you want SQL to do its resource allocation on the default node (node 0), turn on this flag.
Link: https://blogs.msdn.microsoft.com/psssql/2011/11/11/sql-server-clarifying-the-numa-configuration-information

Trace Flag: 8026
Function: SQL Server will clear a dump trigger after generating the dump once
Link: http://support.microsoft.com/kb/917825/en-us
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps

Trace Flag: 8030
Function: Fix for performance bug
Link: http://support.microsoft.com/kb/917035

Trace Flag: 8032
Function: Alters cache limit settings
Warning: Trace flag 8032 can cause poor performance if large caches make less memory available for other memory consumers, such as the buffer pool.
Link: MSDN ms188396
Scope: global only

Trace Flag: 8033
Function: Suppresses messages of the form “The time stamp counter of CPU on scheduler id 1 is not synchronized with other CPUs” from being placed in the SQL Error log when CPU drift is noticed
Warning: SQL 9 - Disable the reporting of CPU Drift errors in the SQL Server error log like time stamp counter of CPU on scheduler id 1 is not synchronized with other CPUs.
Link: https://support.microsoft.com/en-us/help/931279/sql-server-timing-values-may-be-incorrect-when-you-use-utilities-or-technologies-that-change-cpu-frequencies Link: https://blogs.msdn.microsoft.com/psssql/2007/08/19/sql-server-2005-rdtsc-truths-and-myths-discussed

Trace Flag: 8038
Function: Will drastically reduce the number of context switches when running SQL 2005 or 2008
Link: KB972767
Link: http://forum.proxmox.com/threads/15844-Win7-x64-guest-with-SQLServer-2012-High-CPU-usage
Link: TECHNET List Of SQL Server Trace Flags

Trace Flag: 8040
Function: Disables Resource Governor
Link: http://www.sqlservergeeks.com/blogs/AmitBansal/sql-server-bi/64/sql-server-disabling-resource-governor-permanently-somewhat

Trace Flag: 8048
Function: Converts NUMA partitioned memory objects into CPU partitioned
Link: http://sql-sasquatch.blogspot.se/2013/04/startup-trace-flags-i-love.html
Link: https://support.microsoft.com/en-us/kb/2809338
Link: http://blogs.msdn.com/b/psssql/archive/2012/12/20/how-it-works-cmemthread-and-debugging-them.aspx
Link: MSDN ms188396
Link: http://blogs.msdn.com/b/psssql/archive/2011/09/01/sql-server-2008-2008-r2-on-newer-machines-with-more-than-8-cpus-presented-per-numa-node-may-need-trace-flag-8048.aspx
Note: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 8048 has no effect.
Scope: global only

Thanks to: @sql_handle (https://twitter.com/sql_handle) Related to: 8015, 9024

Trace Flag: 8049
Function: SQL 9+ Startup only – Allows use of 1ms times even when patched. Check 8038 for details.
Link: KB972767
Link: https://blogs.msdn.microsoft.com/psssql/2010/08/18/how-it-works-timer-outputs-in-sql-server-2008-r2-invariant-tsc

Trace Flag: 8050
Function: Causes "optional" wait types (see the CSS article) to be excluded when querying sys.dm_os_wait_stats
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/02/the-sql-server-wait-type-repository/

Trace Flag: 8075
Function: Enables a fix (after applying the appropriate CU) for x64 VAS exhaustion.
Link: https://support.microsoft.com/en-us/help/3074434/fix-out-of-memory-error-when-the-virtual-address-space-of-the-sql-server-process-is-very-low-on-available-memory

Trace Flag: 8079
Function: Allows SQL Server 2014 SP2 to interrogate the hardware layout and automatically configure Soft-NUMA on systems reporting 8 or more CPUs per NUMA node. The automatic Soft-NUMA behavior is Hyperthread (HT/logical processor) aware. The partitioning and creation of additional nodes scales background processing by increasing the number of listeners, scaling and network and encryption capabilities. Note: This trace flag applies to SQL Server 2014 SP2. Beginning with SQL Server 2016 this behavior is controlled by the engine and trace flag 8048 has no effect.
Link: KB972767
Link: MSDN ms188396
Scope: global only

Trace Flag: 8202
Function: Used to replicate UPDATE as DELETE/INSERT pair at the publisher. i.e. UPDATE commands at the publisher can be run as an "on-page DELETE/INSERT" or a "full DELETE/INSERT". If the UPDATE command is run as an "on-page DELETE/INSERT," the Logreader send UDPATE command to the subscriber, If the UPDATE command is run as a "full DELETE/INSERT," the Logreader send UPDATE as DELETE/INSERT Pair. If you turn on trace flag 8202, then UPDATE commands at the publisher will be always send to the subscriber as DELETE/INSERT pair.
Link: None

Trace Flag: 8203
Function: Display statement and transaction locks on a deadlock error
Link: None

Trace Flag: 8206
Function: SQL 8 - Supports stored procedure execution with a user specified owner name for SQL Server subscribers or without owner qualification for heterogeneous subscribers
Link: None

Trace Flag: 8207
Function: Enables singleton updates for Transactional Replication. Updates to subscribers can be replicated as a DELETE and INSERT pair. This might not meet business rules, such as firing an UPDATE trigger. With trace flag 8207 an update to a unique column that affects only one row (a singleton update) is replicated as an UPDATE and not as a DELETE or INSERT pair. If the update affects a column on which has a unique constraint or if the update affects multiple rows, the update is still replicated as a DELETE or INSERT pair.
Link: https://blogs.msdn.microsoft.com/psssql/2009/11/02/the-sql-server-wait-type-repository/
Link: MSDN ms188396
Scope: global only

Trace Flag: 8209
Function: Output extra information to error log regarding replication of schema changes in SQL Server Replication
Link: None

Trace Flag: 8295
Function: Creates a secondary index on the identifying columns on the change tracking side table at enable time
Link: https://social.msdn.microsoft.com/forums/sqlserver/en-US/00250311-7991-47b0-b788-7fae2e102254/trace-flag-8295
Link: https://support.microsoft.com/en-us/help/2476322/fix-a-common-table-expression-based-query-that-uses-the-changetable-function-runs-very-slowly-in-sql-server-2008-service-pack-1-or-sql-server-2008-r2
Link: https://www.brentozar.com/archive/2014/06/performance-tuning-sql-server-change-tracking
Link: https://blogs.technet.microsoft.com/smartinez/2013/03/06/sql-server-for-configmgr-2012-ebook-and-top-10-database-issues
Thanks to: Wilfred van Dijk

Trace Flag: 8446
Function: Databases in SQL 8 do not have a Service Broker ID. If you restore these databases on SQL 9 by using the WITH NORECOVERY option, these databases will not be upgraded causing mirroring & log-shipping configurations to fail.
Link: https://support.microsoft.com/en-us/kb/959008

Trace Flag: 8501
Function: Writes detailed information about Ms-DTC context & state changes to the log
Link: None

Trace Flag: 8599
Function: Allows you to use a save-point within a distributed transaction
Link: None

Trace Flag: 8602
Function: Ignore index hints that are specified in query/procedure.
Link: download.microsoft.com/download/6/e/5/6e52bf39-0519-42b7-b806-c32905f4a066/eim_perf_flowchart_final.pdf
Link: http://sqlblog.com/blogs/kalen_delaney/archive/2008/02/26/lost-without-a-trace.aspx

Trace Flag: 8605
Function: Displays logical and physical trees used during the optimization process
Link: More Undocumented Query Optimizer Trace Flags
Link: Yet another X-Ray for the QP

Trace Flag: 8606
Function: Show LogOp Trees
Link: Cardinality Estimation Framework 2014 First Look
Link: Yet another X-Ray for the QP

Trace Flag: 8607
Function: Displays the optimization output tree during the optimization process
Link: Internals of the Seven SQL Server Sorts – Part 1
Link: More Undocumented Query Optimizer Trace Flags
Link: Yet another X-Ray for the QP

Trace Flag: 8608
Function: Shows the initial Memo structure
Link: http://www.queryprocessor.ru/optimizer-part-3-full-optimiztion-optimization-search0
Link: http://www.benjaminnevarez.com/2012/04/inside-the-query-optimizer-memo-structure
Link: http://sqlblog.com/blogs/paul_white/archive/2012/04/29/query-optimizer-deep-dive-part-3.aspx

Trace Flag: 8609
Function: PWhite: “Task and operation type counts”
Link: http://sqlblog.com/blogs/paul_white/archive/2012/05/01/query-optimizer-deep-dive-part-4.aspx
Link: http://www.queryprocessor.ru/good-enough-plan

Trace Flag: 8612
Function: Add Extra Info to the Trees Output
Link: Cardinality Estimation Framework 2014 First Look
Link: http://sqlblog.com/blogs/paul_white/archive/2013/06/11/hello-operator-my-switch-is-bored.aspx

Trace Flag: 8615
Function: Display the final memo structure
Link: http://www.benjaminnevarez.com/2012/04/inside-the-query-optimizer-memo-structure/
Link: http://www.somewheresomehow.ru/optimizer-part-3-full-optimiztion-optimization-search0/

Trace Flag: 8619
Function: Show Applied Transformation Rules
Link: http://sqlblog.com/blogs/paul_white/archive/2013/02/06/incorrect-results-with-indexed-views.aspx
Link: Cardinality Estimation Framework 2014 First Look
Link: Yet another X-Ray for the QP

Trace Flag: 8620
Function: Add memo arguments to trace flag 8619
Link: Query Optimizer Deep Dive - Part 4
Link: Yet another X-Ray for the QP

Trace Flag: 8621
Function: Rule with resulting tree
Link: Query Optimizer Deep Dive - Part 4
Link: Yet another X-Ray for the QP

Trace Flag: 8628
Function: When used with TF 8666, causes extra information about the transformation rules applied to be put into the XML showplan.
Link: Yet another X-Ray for the QP

Trace Flag: 8633
Function: PWhite: “Enable prefetch (CUpdUtil::FPrefetchAllowedForDML and CPhyOp_StreamUpdate::FDoNotPrefetch)”
Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx

Trace Flag: 8649
Function: Set Cost Threshold for parallelism from 1 to 0
Link: http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspx
Link: http://sqlblog.com/blogs/adam_machanic/archive/2013/07/11/next-level-parallel-plan-porcing.aspx
Link: What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1

Trace Flag: 8666
Function: CQScanPartitionSortNew is one of only two sort classes that sets the Soft Sort property exposed when Sort operator execution plan properties are generated with undocumented trace flag 8666 enabled
Link: Internals of the Seven SQL Server Sorts – Part 1
Link: Yet another X-Ray for the QP
Link: https://blogfabiano.com/2012/07/03/statistics-used-in-a-cached-query-plan
Link: http://dataidol.com/davebally/2014/04/12/reasons-why-your-plans-suck-no-56536

Trace Flag: 8671
Function: According to Dima, disables the logic that prunes the memo and prevents the optimization process from stopping due to “Good Enough Plan found”. Can significantly increase the amount of time, CPU, and memory used in the compilation process
Link: http://www.queryprocessor.ru/optimizer_unleashed_2

Trace Flag: 8675
Function: Displays the query optimization phases for a specific optimization
Link: More Undocumented Query Optimizer Trace Flags
Link: http://sqlblog.com/blogs/paul_white/archive/2012/04/29/query-optimizer-deep-dive-part-3.aspx
Link: https://sqlperformance.com/2013/06/sql-indexes/recognizing-missed-optimizations

Trace Flag: 8677
Function: Skips “Search 1” phase of query optimization, and only Search 0 and Search 2 execute.
Link: https://sqlbits.com/Sessions/Event12/Query_Optimizer_Internals_Traceflag_fun

Trace Flag: 8679
Function: Prevents the SQL Server optimizer from using a Hash Match Team operator
Link: None

Trace Flag: 8687
Function: Prevents the SQL Server optimizer from using a Hash Match Team operator
Link: None

Trace Flag: 8690
Undocumented trace flag
Function: Disable the spool on the inner side of nested loop. Spools improve performance in majority of the cases. But it’s based on estimates. Sometimes, this can be incorrect due to unevenly distributed or skewed data, causing slow performance. But in vast majority of situations, you don’t need to manually disable spool with this trace flag.
Link: https://blogs.msdn.microsoft.com/psssql/2015/12/15/spool-operator-and-trace-flag-8690/
Link: http://dba.stackexchange.com/questions/52552/index-not-making-execution-faster-and-in-some-cases-is-slowing-down-the-query
Link: http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=453982

Trace Flag: 8692
Function: Force optimizer to use an Eager Spool for Halloween Protection
Link: http://www.sqlperformance.com/2013/02/sql-plan/halloween-problem-part-4
Link: https://sqlperformance.com/2016/03/sql-plan/changes-to-a-writable-partition-may-fail

Trace Flag: 8719
Function: In SQL 2000, apparently would show IO prefetch on loop joins and bookmarks. I (Aaron) was unable to replicate the query plan behavior on SQL 2012 using the same test, so this flag may be obsolete.
Link: http://www.hanlincrest.com/SQLServerLockEscalation.htm

Trace Flag: 8720
Function: In SQL 2000, apparently would have the same effect as OPTION(KEEPFIXED PLAN)
Link: http://www.hanlincrest.com/SQLserverStoredProcRecompiles.htm

Trace Flag: 8721
Function: Reports to the error log when auto-update statistics executes
Link: https://support.microsoft.com/en-us/kb/195565
Link: MSDN ms188396
Scope: global only

Trace Flag: 8722
Function: Disable all hints except locking hints
Link: http://sqlmag.com/sql-server/investigating-trace-flags

Trace Flag: 8738
Function: (Apparently) disables an optimization where rows are sorted before a Key Lookup operator. (The optimization is meant to promote Sequential IO rather than the random nature of IO from Key Lookups). Note that the context in which this flag is described means that the above description may not be very precise, or even the only use of this flag.
Link: https://answers.sqlperformance.com/questions/603/why-is-the-sort-operator-needed-in-this-plan.html

Trace Flag: 8739
Function: Dima: “Group Optimization Info”
Link: http://www.queryprocessor.ru/good-enough-plan

Trace Flag: 8744
Function: Disable pre-fetching for the Nested Loop operator
Link: KB920093
Link: MSDN ms188396
Link: http://sqlblog.com/blogs/paul_white/archive/2013/03/08/execution-plan-analysis-the-mystery-work-table.aspx
Link: https://connect.microsoft.com/SQLServer/feedback/details/780194/make-dbcc-trace-flags-available-as-option-querytraceon
Scope: global only

Trace Flag: 8746
Function: Whatever else it does, one effect is to disable the “rowset sharing” optimization described in the 2 PWhite posts.
Link: https://sqlperformance.com/2016/03/sql-plan/changes-to-a-writable-partition-may-fail

Trace Flag: 8755
Function: Disable all locking hints
Link: http://sqlmag.com/sql-server/investigating-trace-flags

Trace Flag: 8757
Function: Skip trivial plan optimization and force a full optimization
Link: More Undocumented Query Optimizer Trace Flags
Link: http://sqlblog.com/blogs/paul_white/archive/2012/04/28/query-optimizer-deep-dive-part-1.aspx

Trace Flag: 8758
Function: “A [workaround to the MERGE bug described] is to apply Trace Flag 8758 –unfortunately this disables a number of optimisations, not just the one above, so it’s not really recommended for long term use.” “Disable rewrite to a single operator plan (CPhyOp_StreamUpdate::PqteConvert)”
Link: http://sqlblog.com/blogs/paul_white/archive/2010/08/04/another-interesting-merge-bug.aspx
Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx

Trace Flag: 8765
Function: Allows use of variable length data, from ODBC driver; fixes the issue of a field returning the wrong data length
Link: http://jacob.steelsmith.org/content/sql-server-and-ole-db
Link: https://bugs.mysql.com/bug.php?id=46857

Trace Flag: 8780
Function: Give the optimizer more time to find a better plan
Link: http://www.queryprocessor.ru/optimizer_unleashed_1

Trace Flag: 8783
Function: Allows DELETE, INSERT, and UPDATE statements to honor the SET ROWCOUNT ON setting when enabled
Link: None

Trace Flag: 8790
Function: PWhite: “Undocumented trace flag 8790 forces a wide update plan for any data-changing query (remember that a wide update plan is always possible)”
Link: https://support.microsoft.com/en-us/help/956718/fix-a-merge-statement-may-not-enforce-a-foreign-key-constraint-when-the-statement-updates-a-unique-key-column-that-is-not-part-of-a-clustering-key-and-there-is-a-single-row-as-the-update-source-in-sql-server-2008
Link: http://sqlblog.com/blogs/paul_white/archive/2012/12/10/merge-bug-with-filtered-indexes.aspx
Link: https://sqlperformance.com/2014/06/sql-plan/filtered-index-side-effect

Trace Flag: 8795
Function: PWhite: “Disable DML Request Sort (CUpdUtil::FDemandRowsSortedForPerformance)”
Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx
Link: https://sqlperformance.com/2014/10/t-sql-queries/performance-tuning-whole-plan

Trace Flag: 8809
Function: Extended Page Heap Activities. Referenced in passing in the CSS article in relation to debugging memory scribbler problems.
Link: https://blogs.msdn.microsoft.com/psssql/2012/11/12/how-can-reference-counting-be-a-leading-memory-scribbler-cause/

Trace Flag: 8816
Function: Logs every two-digit year conversion to a four-digit year
Link: None

Trace Flag: 8901
Function: Enables new (in 7.0) code to correct a problem with the SHRINK command and empty text or image extents
Link: None

Trace Flag: 8903
Function: Allows SQL Server to use a specific API (SetFileIoOverlappedRange) when Locked Pages in Memory is enabled.
Link: https://blogs.msdn.microsoft.com/psssql/2012/03/20/setfileiooverlappedrange-can-lead-to-unexpected-behavior-for-sql-server-2008-r2-or-sql-server-2012-denali Link: https://support.microsoft.com/en-us/help/2679255/sql-server-data-corruption-when-a-memory-range-is-accessed-by-the-setfileiooverlappedrange-function-and-an-i-o-operation-in-windows-vista,-in-windows-server-2008,-in-windows-7,-or-in-windows-server-2008-r2 Link: https://blogs.msdn.microsoft.com/psssql/2013/10/16/every-time-i-attach-database-sql-logs-error-1314-for-setfileiooverlappedrange

Trace Flag: 9024
Function: Converts a global log pool memory object into NUMA node partitioned memory object
Note: Beginning with SQL Server 2012 SP3 and SQL Server 2014 SP1 this behavior is controlled by the engine and trace flag 9024 has no effect.
Link: https://support.microsoft.com/en-us/kb/2809338
Link: MSDN ms188396
Scope: global only
Related to: 8048

Trace Flag: 9050
Function: “FIX: The compile time for a query that uses at least one outer join may be greater for SQL Server post-SP3 builds”
Link: None

Trace Flag: 9052
Function: “FIX: Queries that join a view may run slowly if the view contains outer joins”
Link: None

Trace Flag: 9054
Function: “FIX: SQL Server 2000 Service Pack 1 (SP1) and later builds may not generate an execution plan for a query, and you receive error message 8623”
Link: None

Trace Flag: 9055
Function: “FIX: The performance of a DML operation that fires a trigger may decrease when the trigger execution plan recompiles repeatedly”
Link: None

Trace Flag: 9056
Function: “FIX: A user-defined function returns results that are not correct for a query”
Link: None

Trace Flag: 9059
Function: SQL 8 - Turns back behavior to SP3 after a SP4 installation, this allows to choose an index seek when comparing numeric columns or numeric constants that are of different precision or scale; else would have to change schema/code.
Link: None

Trace Flag: 9061
Function: “FIX: Build 8.00.0837: A query that contains a correlated subquery runs slowly”
Link: None

Trace Flag: 9062
Function: “FIX: Some complex queries are slower after you install SQL Server 2000 Service Pack 2 or SQL Server 2000 Service Pack 3”
Link: None

Trace Flag: 9063
Function: “FIX: Query performance may be slower if the query contains both a GROUP BY clause and a DISTINCT keyword on the same column”
Link: None

Trace Flag: 9065
Function: “FIX: The query plan may take longer than expected to compile, and you may receive error message 701, error message 8623, or error message 8651 in SQL Server 2000”
Link: None

Trace Flag: 9068
Function: “FIX: A query may run more slowly against SQL Server 2000 post-SP3 hotfix build 8.00.0988 than a query that you run against SQL Server 2000 post-SP3 hotfix builds that are earlier than build 8.00.0988”
Link: None

Trace Flag: 9079
Function: “FIX: The query performance may be slow when you query data from a view in SQL Server 2000”
Link: None

Trace Flag: 9082
Function: SQL 9 - Stored procedure using views, perform slow compared to ver 8 if views use JOIN operator and contain sub queries
Link: None

Trace Flag: 9109
Function: Used to workaround a problem with query notifications and restoring a DB with the NEW_BROKER option enabled.
Link: https://support.microsoft.com/en-us/help/2483090/restore-or-recovery-may-fail-or-take-a-long-time-if-query-notification-is-used-in-a-database

Trace Flag: 9115
Function: PWhite: “Disable prefetch (CUpdUtil::FPrefetchAllowedForDML)” Dima: “Disables both [NLoop Implicit Batch Sort {TF 2340} and NL Prefetching {TF 8744}], and not only on the Post Optimization, but the explicit Sort also”
Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx
Link: http://www.hanlincrest.com/SQLServerLockEscalation.htm
Link: http://www.queryprocessor.com/batch-sort-and-nested-loops

Trace Flag: 9130
Function: Disables the particular copy out stage rewrite from Filter + (Scan or Seek) to (Scan or Seek) + Residual Predicate. Enabling this flag retains the Filter in the final execution plan, resulting in a SQL Server 2008+ plan that mirrors the 2005 version.
Link: http://sqlblog.com/blogs/paul_white/archive/2012/10/15/cardinality-estimation-bug-with-lookups-in-sql-server-2008-onward.aspx
Link: http://sqlblogcasts.com/blogs/sqlandthelike/archive/2012/12/06/my-new-favourite-traceflag.aspx
Link: http://sqlblog.com/blogs/paul_white/archive/2013/06/11/hello-operator-my-switch-is-bored.aspx
Link: https://connect.microsoft.com/SQLServer/feedback/details/767395/cardinality-estimation-error-with-pushed-predicate-on-a-lookup
Link: http://www.theboreddba.com/Categories/FunWithFlags/Revealing-Predicates-in-Execution-Plans-(TF-9130).aspx

Trace Flag: 9134
Function: SQL 8 - Does additional reads to test if the page is allocated & linked correctly this checks IAM & PFS. Fixes error 601 for queries under Isolation level read uncommitted. In case performance is affected (because of a bug) apply SP4.
Link: https://support.microsoft.com/en-us/help/815008/fix-query-with-transaction-isolation-level-set-to-read-uncommitted-fails-with-error-601

Trace Flag: 9136
Function: “PRB: You receive error message 8623 when you try to run a query that joins multiple tables”
Link: None

Trace Flag: 9185
Function: Cardinality estimates for literals that are outside the histogram range are very low
Link: None Related to: 9205

Trace Flag: 9204
Function: Output Statistics used by Query Optimizer. When enabled and a plan is compiled or recompiled there is a listing of statistics which is being fully loaded & used to produce cardinality and distribution estimates for some plan alternative or other.
Link: http://sqlblog.com/blogs/paul_white/archive/2011/09/21/how-to-find-the-statistics-used-to-compile-an-execution-plan.aspx
Related to: 9292

Trace Flag: 9205
Function: Cardinality estimates for literals that are outside the histogram range are very low for tables that have parent-child relationships
Link: None Related to: 9185

Trace Flag: 9207
Function: Fixes that SQL Server underestimates the cardinality of a query expression and query performance may be slow
Link: None

Trace Flag: 9209
Function: “FIX: Some queries that have a left outer join and an IS NULL filter run slower after you install SQL Server 2000 post-SP3 hotfix”
Link: None

Trace Flag: 9210
Function: “FIX: A query filter condition that has a LEFT OUTER JOIN clause may cause an incorrect row count estimate in the query execution plan”
Link: None

Trace flag: 9259
Function: Disables Project Normalization step
Note: Please, don’t use TF 9259 that disables Project Normalization step in a real production system, besides it is undocumented and unsupported, it may hurt your performance.
Link: http://www.queryprocessor.com/sudf-ce/

Trace flag: 9268
Function: SQL 8 - When SQL Server runs a parameterized query that contains several IN clauses, each with a large number of values, SQL Server may return the following error message after a minute or more of high CPU utilization: KB 325658. Server: Msg 8623, Level 16, State 1. Internal Query Processor Error: The query processor could not produce a query plan. Contact your primary support provider for more information.
Link: None

Trace Flag: 9292
Function: Output Statistics considered to be used by Query Optimizer
Link: http://sqlblog.com/blogs/paul_white/archive/2011/09/21/how-to-find-the-statistics-used-to-compile-an-execution-plan.aspx
Related to: 9204

Trace Flag: 9347
Function: Disables batch mode for sort operator. SQL Server 2016 introduces a new batch mode sort operator that boosts performance for many analytical queries.
Link: https://support.microsoft.com/en-us/kb/3172787
Link: MSDN ms188396
Link: Niko Neugebauer Columnstore Indexes – part 86
Scope: global only

Trace Flag: 9348
Function: Sets a row limit (based on cardinality estimates) that controls whether a bulk insert is attempted or not (assuming conditions are met for a bulk insert). Introduced as a workaround for memory errors encountered with bulk insert.
Link: https://support.microsoft.com/en-us/help/2998301/fix-error-8654-when-you-run-insert-into-select-on-a-table-with-clustered-columnstore-index-in-sql-server-2014

Trace Flag: 9349
Link: https://support.microsoft.com/en-us/kb/3172787
Function: Disables batch mode for top N sort operator. SQL Server 2016 introduces a new batch mode top sort operator that boosts performance for many analytical queries.
Link: MSDN ms188396
Link: Niko Neugebauer Columnstore Indexes – part 86
Scope: global or session or query

Trace Flag: 9354
Undocumented trace flag
Function: Disable aggregate pushdown operations for columnstore indexes. The number of rows aggregated at the level of the scan is displayed in the new property plan Actual Number Of Locally Aggregated Rows. TF 9354 can be used to disable the push of aggregation, the difference can be observed by the runtime, according to the number of rows in the plan Actual Number Of Locally Aggregated Rows and number Actual Number Of Rows output from the scan operator.
Example:

use AdventureworksDW2016CTP3;
set nocount on;
go
-- Undocumented TF 9354 disables this optimization, run to see Aggregation Pushdown Performance Gain
set statistics xml, time on;
select count_big(*) from dbo.FactResellerSalesXL_CCI;
select count_big(*) from dbo.FactResellerSalesXL_CCI option(querytraceon 9354); -- undocumented/unsupported TF 9354 to disable aggregate pushdown
set statistics xml, time off;

Trace Flag: 9358
Function: Disable batch mode sort operations in a complex parallel query. For example, this flag could apply if the query contains merge join operations.
Link: Niko Neugebauer Columnstore Indexes – part 86
Link: https://support.microsoft.com/en-us/kb/3171555

Trace Flag: 9389
Function: Enables dynamic memory grant for batch mode operators. If a query does not get all the memory it needs, it spills data to tempdb, incurring additional I/O and potentially impacting query performance. If the dynamic memory grant trace flag is enabled, a batch mode operator may ask for additional memory and avoid spilling to tempdb if additional memory is available.
Link: Niko Neugebauer Columnstore Indexes – part 86
Link: MSDN ms188396
Scope: global or session

Trace Flag: 9394
Function: Apparently enables a fix for an access violation when a table with Japanese characters has an indexed changed.
Link: https://support.microsoft.com/en-us/help/3142595/fix-an-access-violation-occurs-when-a-database-table-name-contains-japanese-characters-in-sql-server-2012-or-sql-server-2014
Link: https://support.microsoft.com/en-us/help/3138659/fix-slow-performance-when-you-query-numeric-data-types-from-an-oracle-database

Trace Flag: 9453
Function: Disables Batch Mode in Parallel Columnstore query plans. (Note that a plan using batch mode appears to require a recompile before the TF takes effect) Sunil Agarwal also used this trace flag in demo scripts for a PASS 2014 session on column store indexing
Link: Niko Neugebauer Columnstore Indexes – part 35
Link: What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1

Trace Flag: 9471
Function: Causes SQL Server to generate a plan using minimum selectivity for single-table filters, under the query optimizer cardinality estimation model of SQL Server 2014 through SQL Server 2016 versions. Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 9472
Function: Assumes independence for multiple WHERE predicates in the SQL 2014 cardinality estimation model. Predicate independence was the default for versions prior to SQL Server 2014, and thus this flag can be used to more closely emulate pre-SQL 2014 cardinality estimate behavior in a more specific fashion than TF 9481.
Link: https://sqlperformance.com/2014/01/sql-plan/cardinality-estimation-for-multiple-predicates
Link: https://connect.microsoft.com/SQLServer/feedback/details/801908/sql-server-2014-cardinality-estimation-regression

Trace Flag: 9275
Function: “FIX: A DML Operation on a Large Table Can Cause Performance Problems” Enables SQL 2000 optimizations that sort data in DML statements before the changes are applied to a clustered index
Link: None

Trace Flag: 9476
Function: Causes SQL Server to generate a plan using the Simple Containment assumption instead of the default Base Containment assumption, under the query optimizer cardinality estimation model of SQL Server 2014 through SQL Server 2016 versions. Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.
Link: https://support.microsoft.com/en-us/kb/3189675
Link: New Features in SQL Server 2016 Service Pack 1
Link: MSDN ms188396
Scope: global or session or query

Trace Flag: 9481
Function: Enables you to set the query optimizer cardinality estimation model to the SQL Server 2012 and earlier version independent of the compatibility level of the database. To accomplish this at the database level, see ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL). To accomplish this at the query level, add the QUERYTRACEON query hint
Link: New Features in SQL Server 2016 Service Pack 1
Link: https://sqlserverscotsman.wordpress.com/2016/11/28/a-guide-on-forcing-the-legacy-ce/
Link: MSDN ms188396
Link: KB2801413
Scope: global or session or query

Trace Flag: 9482
Function: Implements a “model variation” in the SQL 2014 cardinality estimator. The flag turns off the “overpopulated primary key” adjustment that the optimizer might use when determining that a “dimension” table (the schema could be OLTP as well) has many more distinct values than the “fact” table. (The seminal example is where a Date dimension is populated out into the future, but the fact table only has rows up to the current date). Since join cardinality estimation occurs based on the contents of the histograms of the joined columns, an “overpopulated primary key” can result in higher selectivity estimates, causing rowcount estimates to be too low.
Link: http://www.queryprocessor.com/ce_opk

Trace Flag: 9483
Function: Implements a “model variation” in the SQL 2014 cardinality estimator. The flag will force the optimizer to create (if possible) a filtered statistics object based on a predicate in the query. This filtered stat object is not persisted and thus would be extremely resource intensive for frequent compilations. In Dima’s example, the filtered stat object is actually created on the join column...i.e. “CREATE STATISTICS [filtered stat obj] ON table WHERE (predicate column = ‘literal’)”
Link: http://www.queryprocessor.com/ce_filteredstats

Trace Flag: 9485
Function: Disables SELECT permission for DBCC SHOW_STATISTICS
Link: https://support.microsoft.com/en-us/kb/2683304
Link: MSDN ms188396
Link: http://www.benjaminnevarez.com/2013/02/dbcc-show_statistics-works-with-select-permission
Scope: global only

Trace Flag: 9488
Function: Implements a “model variation” in the SQL 2014 cardinality estimator. This flag reverts the estimation behavior for multi-statement TVFs back to 1 row (instead of the 100-row estimate behavior that was adopted in SQL 2014).
Link: http://www.queryprocessor.com/ce_mtvf

Trace Flag: 9489
Function: Implements a “model variation” in the SQL 2014 cardinality estimator and turns off the new logic that handles ascending keys.
Link: http://www.queryprocessor.com/ce_asckey

Trace Flag: 9495
Function: Disables parallelism during insertion for INSERT...SELECT operations and it applies to both user and temporary tables
Link: https://support.microsoft.com/en-us/kb/3180087
Link: MSDN ms188396
Scope: global or session

Trace Flag: 9532
Function: SQL 11 CTP3 - to get more than 1 availability group replica in CTP3 Scope Startup
Link: http://connect.microsoft.com/SQLServer/feedback/details/682581/denali-hadron-read-only-routing-url-is-not-yet-implemente

Trace Flag: 9559
Function: For AGs, “when enabled on the secondary ignores the redo target provided from the primary progress message and always set the redo target at the Max LSN value.”
Link: https://blogs.msdn.microsoft.com/alwaysonpro/2013/12/04/recovery-on-secondary-lagging-shared-redo-target

Trace Flag: 9567
Function: Enables compression of the data stream for availability groups during automatic seeding. Compression can significantly reduce the transfer time during automatic seeding and will increase the load on the processor.
Link: MSDN ms188396
Link: https://www.mssqltips.com/sqlservertip/4537/sql-server-2016-availability-group-automatic-seeding/
Link: https://msdn.microsoft.com/en-us/library/mt735149.aspx
Link: MSDN mt736907
Scope: global or session

Trace Flag: 9592
Function: Enables log stream compression for synchronous availability groups. This feature is disabled by default on synchronous availability groups because compression adds latency.
Link: MSDN ms188396
Link: MSDN mt736907
Scope: global or session

Trace Flag: 9806
Function: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Windows Azure VM
Link: None

Trace Flag: 9807
Function: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Windows Azure VM
Link: None

Trace Flag: 9808
Function: Unknown. Is turned on on SQL Server 2014 CTP1 standard installation in Windows Azure VM
Link: None

Trace Flag: 9830
Undocumented trace flag
Function: Activate the trace flag before creating a natively compiled procedure. If you now open up the SQL Server error log you should see the compilation process for the natively compiled procedure. This is an undocumented trace flag so please don’t use this on a production system.
Link: https://web.archive.org/web/20160327221828/http://speedysql.com/2015/10/28/new-trace-flag-for-in-memory-oltp-hekaton/

Trace Flag: 9837
Function: According to Bob Ward’s PASS 2014 talk on SQL Server IO, enables “extra tracing but massive output” for Hekaton checkpoint files.
Link: None

Trace Flag: 9851
Undocumented trace flag
Function: For testing purposes, you might want to turn off automatic merging of files, so that you can more readily explore this metadata. You can do that by turning on the undocumented trace flag 9851. And of course, be sure to turn off the trace flag when done testing.
Link: http://gsl.azurewebsites.net/Portals/0/Users/dewitt/talks/HekatonWhitePaper.pdf

Trace Flag: 9929
Function: Enables an update that reduces the “disk footprint [of In-Memory OLTP] by reducing the In-Memory checkpoint files to 1 MB (megabytes) each.”
Link: https://support.microsoft.com/en-us/help/3147012/fix-large-disk-checkpoint-usage-occurs-for-an-in-memory-optimized-filegroup-during-heavy-non-in-memory-workloads

Trace Flag: 9989
Function: In CTP2, enabled functionality for reading in-memory tables on a readable secondary
Link: https://connect.microsoft.com/SQLServer/feedback/details/795360/secondary-db-gets-suspect-when-i-add-in-memory-table-to-db-which-is-part-of-alwayson-availability-group

Trace Flag: 10202
Function: According to demo scripts from a Sunil Agarwal session at PASS 2014, enables a new DMV named sys.dm_db_column_store_row_group_physical_stats. This DMV is not in SQL 2014 RTM and Sunil did not perform this demo during the session, so this DMV appears to be in a future (or internal) version of SQL Server.
Link: None

Trace Flag: 10207
Function: When a Clustered Columnstore index has corrupted segments, turning on this flag suppresses errors 5288 and 5289 and allows a scan of a clustered columns store to skip corrupt segments and complete (though with results that do not include the corrupted segment(s)). This flag is helpful when attempting to copy-out data in a corrupt CCI.
Link: https://support.microsoft.com/en-us/help/3067257/fix-partial-results-in-a-query-of-a-clustered-columnstore-index-in-sql-server-2014 Link: https://blogs.msdn.microsoft.com/sqlreleaseservices/partial-results-in-a-query-of-a-clustered-columnstore-index-in-sql-server-2014

Trace Flag: 10204
Function: Disables merge/recompress during columnstore index reorganization. In SQL Server 2016, when a columnstore index is reorganized, there is new functionality to automatically merge any small compressed rowgroups into larger compressed rowgroups, as well as recompressing any rowgroups that have a large number of deleted rows.
Note: Trace flag 10204 does not apply to column store indexes which are created on memory-optimized tables.
Link: MSDN ms188396
Scope: global or session

Trace Flag: 10213
Function: Enables the option to configure compression delay in columnstore indexes in SQL Server 2016
Link: http://www.nikoport.com/2016/02/04/columnstore-indexes-part-76-compression-delay/
Scope: session

Trace Flag: 10316
Function: Enables creation of additional indexes on internal memory-optimized staging temporal table, beside the default one. If you have specific query pattern that includes columns which are not covered by the default index you may consider adding additional ones.
Note: System-versioned temporal tables for Memory-Optimized Tables are designed to provide high transactional throughput. Please be aware that creating additional indexes may introduce overhead for DML operations that update or delete rows in the current table. With the additional indexes you should aim to find the right balance between performance of temporal queries and additional DML overhead.
Link: MSDN ms188396
Link: https://support.microsoft.com/en-us/kb/3198846
Link: https://blogs.msdn.microsoft.com/sqlcat/2016/12/08/improve-query-performance-on-memory-optimized-tables-with-temporal-using-new-index-creation-enhancement-in-sp1/
Scope: global or session

Article are also in markdown format: https://github.com/ktaranov/sqlserver-kit

 
Total article views: 2469 | Views in the last 30 days: 104
 
Related Articles
ARTICLE

Stairway to Server-side Tracing - Level 5: How to View and Manage Running Traces

An introduction to the SQL Trace catalog views and functions used to view existing trace definitions...

BLOG

Server Side trace

Most of us are aware of tracing queries using SQL profiler. But an effective way of performing...

ARTICLE

SQL Server Trace Flags

A comprehensive list of trace flags for SQL Server that you can use to configure your server instanc...

FORUM

trace

trace

ARTICLE

Stairway to Server-side Tracing - Level 1 - Overview of Tracing

The first part of our stairway series on SQL Trace examines the overview of this subsystem in SQL Se...

Tags
trace-flag    
 
Contribute