Professional Documents
Culture Documents
IQ Information Remediations
IQ Information Remediations
USE msdb;
GO
Enable 'disallow results from triggers' option as the ability to return result sets from triggers
will be removed in a future version
Use the disallow results from triggers option to control whether triggers return result
sets. Triggers that return result sets may cause unexpected behavior in applications that
aren't designed to work with them.
-- Set the disallow results from triggers option to 1. This is an advanced option so that must be
enabled first
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
USE master;
GO
Review non-default value 2147483647 for the 'max text repl size' option
SSMS
Review non-default value 1024 for the 'min server memory (MB)' option
SSMS
3.
Review non-default value 60 for the 'remote login timeout (s)' option
3. Under Network, select a value for the Remote Login Timeout box.
cpu_count AS logicalCPUs
FROM sys.dm_os_sys_info;
USE master;
GO
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE
GO
EXEC sp_configure 'cost threshold for parallelism', 10;
GO
RECONFIGURE
GO
SELECT value
FROM sys.configurations
GO
1. In Object Explorer, right-click a server and select Properties.
RECONFIGURE;
GO
GO
RECONFIGURE;
GO
GO
RECONFIGURE
GO
Use 'RECONFIGURE' after 'sp_configure' to update run value. Config value is different from
run value in: affinity mask
USE AdventureWorks2022;
GO
GO
RECONFIGURE ;
GO
GO
RECONFIGURE;
GO
Use <join_hint>, <query_hint> and <table_hint> in specific cases only since SQL Server Query
Optimizer typically selects best execution plan for queries
Caution
Because the SQL Server query optimizer typically selects the best execution plan
for a query, we recommend that <join_hint>, <query_hint>, and <table_hint>
be used only as a last resort by experienced developers and database
administrators.
https://techcommunity.microsoft.com/t5/sql-server-blog/sql-server-2016-
changes-in-default-behavior-for-autogrow-and/ba-p/384692
Syntax
ALTER DATABASE <dbname> MODIFY FILEGROUP <filegroup>
{ AUTOGROW_ALL_FILES | AUTOGROW_SINGLE_FILE }
Best Practice: Carefully consider whether to use trace flag 1117 because it affects all
databases. Instead, consider preallocating space to tempdb files to accommodate typical
workloads.
DBCC TRACESTATUS();
DBCC TRACEON(1117,-1);
DBCC TRACEOFF(1117,-1);
DBCC TRACESTATUS();
DBCC TRACEON(174,-1);
DBCC TRACEOFF(174,-1);
2016
Syntax
ALTER DATABASE <dbname> SET MIXED_PAGE_ALLOCATION { ON | OFF }
For more information, see https://msdn.microsoft.com/en-US/library/bb522682.aspx
Example
–Default value is OFF so all allocations in AdventureWorks will use uniform extents. To disable and
use mixed extents turn the setting to on.
ALTER DATABASE AdventureWorks SET MIXED_PAGE_ALLOCATION ON;
2014
DBCC TRACESTATUS();
DBCC TRACEON(1118,-1);
DBCC TRACEOFF(1118,-1);
DBCC TRACESTATUS();
DBCC TRACEON(6534,-1);
DBCC TRACEOFF(6534,-1);
Enable trace flag 7412 to enable lightweight profiling infrastructure for live query
performance troubleshooting
DBCC TRACESTATUS();
DBCC TRACEON(7412,-1);
DBCC TRACEOFF(7412,-1);
Enable trace flags 6532 and 6533 to improve spatial data performance
DBCC TRACESTATUS();
DBCC TRACEON(6532,-1);
DBCC TRACEOFF(6532,-1);
Enable trace flag 834 to use large-page allocations to improve analytical and data
warehousing workloads
Enable trace Flag 2371 to allow linear recompilation threshold for statistics
Trace Flag 2371 causes SQL Server to change the fixed update statistics threshold to a linear
update statistics threshold. This is especially useful to keep statistics updated on large tables.
Starting with SQL Server 2016, for databases using compatibility level 130 and above, this
behavior is controlled by the engine and trace flag 2371 has no effect.
SQL Server 2014 or below: default is the old threshold. You can use trace flag 2371 to activate new
threshold
SQL Server 2016: Default is new threshold if database compatibility level is 130. If database
compatibility is below 130, old threshold is used (unless you use trace flag 2371)
Trace Flag 4199 enables Query Optimizer fixes. Verify need to set a non-default trace flag
with the current system build and configuration
https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-
database-transact-sql-compatibility-level?view=sql-server-ver16
https://support.microsoft.com/en-us/topic/kb974006-sql-server-query-
optimizer-hotfix-trace-flag-4199-servicing-model-cd3ebf5c-465c-6dd8-7178-
d41fdddccc28
If DBCC TRACEON\TRACEOFF is used this does not regenerate a new cached plan for stored procedures. Plans could be
in cache that were created without the trace flag.
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/
scm-services-configure-server-startup-options?view=sql-server-
ver16&redirectedfrom=MSDN