I did my 5 minute research and have not come up with a concise list, or even a list really except for Trace Flags (2012) which is a bit lacking.

Looking at this query which uses 8691, I was wondering if such a list exists.

with cte(guid,other) as ( 
select newid(),1 union all 
select newid(),2 union all 
select newid(),3) 
select a.guid, a.other, b.guid guidb, b.other otherb 
from cte a 
cross join cte b 
order by a.other, b.other 
OPTION (QUERYTRACEON 8691);

closed as off-topic by Paul White Nov 2 '16 at 10:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Shopping list question - questions about which tool, library, product or resource you should use are off-topic here because they quickly become obsolete and often are just about the preferences of the answerer. If you have an issue with or a question about a specific tool, please revise your question to conform to that scope." – Paul White
If this question can be reworded to fit the rules in the help center, please edit the question.

locked by Paul White Nov 2 '16 at 10:35

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

  • 1
    The vast majority of Trace Flags are undocumented as they should not be used. They are there for advanced troubleshooting purposes by the SQL support team only. The link you found is valid for known and supported trace flags. – Nic Oct 26 '12 at 21:31
  • I stumbled upon a great list of the most important trace flags of SQL Server, sharing as you might find this VERY useful sqlturbo.com/the-most-important-trace-flags-for-sql-server – user55759 Dec 29 '14 at 14:57
up vote 6 down vote accepted

http://antapex.org/traceflags_sqlserver.txt

Although this isn't complete, it is the biggest single list I know of.

This MSDN article lists the Query Optimizer Trace Flags necessary to support several changes to the QO in various QFEs and hotfixes, etc.

http://support.microsoft.com/kb/974006

Technet also has a list of various trace flags (probably already documented in the links above:

http://technet.microsoft.com/en-us/library/ms188396.aspx

This documents trace flag 610: http://msdn.microsoft.com/en-us/library/dd425070%28v=SQL.100%29.aspx (controls minimally logged inserts into indexed tables)

Technet has another huge list of trace flags at: http://social.technet.microsoft.com/wiki/contents/articles/13105.trace-flags-in-sql-server.aspx

The list of trace flags which you found on MSDN are the only flags which you should be running.

Anything which isn't documented is only supposed to be used by the developers and PSS when troubleshooting problems.

Even though this is a pretty old thread, Microsoft has officially published the list of Trace Flags that can be used when running SQL Server 2012 and up for high performance workloads :

KB - 2964518 - Recommended updates and configuration options for SQL Server 2012 and SQL Server 2014 with high-performance workloads.

Its highly advisable to do a thorough testing when enabling trace flags to avoid any surprises.

I thought I'd create a table for quick reference.

CREATE TABLE dbo.TraceDefinition (
 TraceFlag INT NOT NULL CONSTRAINT PK_TradeDefinition PRIMARY KEY CLUSTERED,
 [Description] VARCHAR(MAX) NOT NULL
)

INSERT INTO dbo.TraceDefinition (TraceFlag, [Description])
SELECT TraceFlag, [Description]
FROM (VALUES (260, 'Prints versioning information about extended stored procedure dynamic-link libraries (DLLs). For more information about __GetXpVersion(), see Creating Extended Stored Procedures. Scope: global or session'),
        (1204,'Returns the resources and types of locks participating in a deadlock and also the current command affected. Scope: global only'),
        (1211,'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. For more information, see Lock Escalation (Database Engine). 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. Scope: global or session'),
        (1222,'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. Scope: global only'),
        (1224,'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, exclusive of memory allocation using Address Windowing Extension (AWE). 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 Setting Server Configuration Options. 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. Scope: global or session'),
        (2528,'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 max degree of parallelism 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. Scope: global or session'),
        (3205,'By default, if a tape drive supports hardware compression, either the DUMP or BACKUP statement uses it. With this trace flag, you can disable hardware compression for tape drivers. This is useful when you want to exchange tapes with other sites or tape drives that do not support compression. Scope: global or session'),
        (3226,'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.'),
        (3608,'Prevents SQL Server from automatically starting and recovering any database except the master database. Databases will be started and recovered when accessed. Some features, such as snapshot isolation and read committed snapshot, might not work. Use for Moving System Databases and Moving User Databases. Do not use during normal operation.'),
        (3625,'Limits the amount of information returned in error messages. For more information, see Metadata Visibility Configuration. Scope: global only'),
        (4616,'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. Scope: global only'),
        (6527,'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 behavior 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. Scope: global only'),
        (7806,'Enables a dedicated administrator connection (DAC) on SQL Server Express. By default, no DAC resources are reserved on SQL Server Express. For more information, see Using a Dedicated Administrator Connection.')
) AS t(TraceFlag,[Description])

Not the answer you're looking for? Browse other questions tagged or ask your own question.