You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SQL Server Trace Flag.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ A lowercase "t" is accepted by SQL Server, but this sets other internal trace fl
82
82
## What are Microsoft SQL Server Trace Flags?
83
83
Trace Flags are settings that in some way or another alters the behavior of various SQL Server functions: [Docs Trace Flags]
84
84
85
-
Trace flags are used to set specific server characteristics or to alter a particular behavior. For example, trace flag 3226 is a commonly used startup trace flag which suppresses successful backup messages in the error log.
85
+
Trace flags are used to set specific server characteristics or to alter a particular behavior. For example, trace flag [3226](#3226) is a commonly used startup trace flag which suppresses successful backup messages in the error log.
86
86
Trace flags are frequently used to diagnose performance issues or to debug stored procedures or complex computer systems, but they may also be recommended by Microsoft Support to address behavior that is negatively impacting a specific workload.
87
87
All documented trace flags and those recommended by Microsoft Support are fully supported in a production environment when used as directed.
88
88
Note that trace flags in this list may have additional considerations regarding their particular usage, so it is advisable to carefully review all the recommendations given here and/or by your support engineer.
Function: If you enable global TF 3449 (and you are on SQL Server 2012 SP3 CU3 or later or SQL Server 2014 SP1 CU7 or later),
2437
2437
you will get much better performance by avoiding a FlushCache call in a number of different common scenarios, such as backup database,
2438
-
backup transaction log, create database, add a file to a database, restore a transaction log, recover a database, shrink a database file, and a SQL Server “graceful” shutdown.
2438
+
backup transaction log, create database, add a file to a database, restore a transaction log, recover a database, shrink a database file, and a SQL Server “graceful” shutdown.<br />
Link: [Hidden Performance & Manageability Improvements in SQL Server 2012 / 2014]<br />
@@ -3125,18 +3125,25 @@ Scope: global or session or query
3125
3125
3126
3126
<aid="4199"></a>
3127
3127
#### Trace Flag: 4199
3128
+
**Important: Query Optimizer fixes that address wrong results or access violation errors are not enabled by trace flag 4199.
3129
+
Those fixes are not considered optional and become enabled by default once the update package is installed.**<br />
3128
3130
Function: Enables query optimizer (QO) changes released in SQL Server Cumulative Updates and Service Packs.
3129
-
QO changes that are made to previous releases of SQL Server are enabled by default under the latest database compatibility level in a given product release, without trace flag 4199 enabled.<br />
3131
+
QO changes that are made to previous releases of SQL Server are enabled by default under the latest database [compatibility level](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level) in a given product release, without trace flag 4199 enabled.<br />
3130
3132
The following table summarizes the behavior when using specific database compatibility levels and trace flag 4199:
3131
3133
3132
-
| Database compatibility level | TF 4199 | QO changes from previous database compatibility levels | QO changes for current version post-RTM |
To enable this at the database level, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)].<br />
3139
-
**Note: Starting with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT [query hint](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query) instead of using this trace flag.**<br />
3134
+
|Database Engine (DE) version | Database compatibility level | TF 4199 | QO changes from all previous Database Compatibility Levels | QO changes for DE version post-RTM |
Starting with SQL Server 2016 (13.x), to accomplish this at the database level, see the QUERY_OPTIMIZER_HOTFIXES option in [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql).
3146
+
Starting with SQL Server 2016 (13.x) SP1, to accomplish this at the query level, add the USE HINT [query hint](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query) instead of using this trace flag.<br />
0 commit comments