SQL DB Toc Fromms01
SQL DB Toc Fromms01
Overview
What's New - SQL Server 2017
What's New - SQL Server 2016
Release notes
Backward compatibility
Deprecated features in SQL Server 2017
Deprecated in SQL Server 2016
Discontinued functionality in SQL Server 2016
Breaking changes in SQL Server 2017
Breaking changes in SQL Server 2016
New and updated articles
Install
Configure
High availability
Availability groups
Database mirroring
Log shipping
SQL Server Database Engine
11/20/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
The Database Engine is the core service for storing, processing, and securing data. The Database Engine provides
controlled access and rapid transaction processing to meet the requirements of the most demanding data
consuming applications within your enterprise.
Use the Database Engine to create relational databases for online transaction processing or online analytical
processing data. This includes creating tables for storing data, and database objects such as indexes, views, and
stored procedures for viewing, managing, and securing data. You can use SQL Server Management Studio to
manage the database objects, and SQL Server Profiler to capture server events.
See Also
SQL Server Resource Center
What's new in Database Engine - SQL Server 2017
12/5/2017 • 8 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2017) Azure SQL Database Azure SQL Data Warehouse
Parallel Data Warehouse
This topic describes improvements made to the SQL Server Database Engine for SQL Server 2017. Click the links
for more information on each item.
NOTE
SQL Server 2017 also includes the features added in SQL Server 2016 service packs. For those items, see What's New in SQL
Server 2016 (Database Engine).
Enhancements
CLR uses Code Access Security (CAS) in the .NET Framework, which is no longer supported as a security
boundary. A CLR assembly created with PERMISSION_SET = SAFE may be able to access external system
resources, call unmanaged code, and acquire sysadmin privileges. Beginning with SQL Server 2017, an
sp_configure option called clr strict security is introduced to enhance the security of CLR assemblies.
clr strict security is enabled by default, and treats SAFE and EXTERNAL_ACCESS assemblies as if they were
marked UNSAFE . The clr strict security option can be disabled for backward compatibility, but this is not
recommended. Microsoft recommends that all assemblies be signed by a certificate or asymmetric key with a
corresponding login that has been granted UNSAFE ASSEMBLY permission in the master database. CLR assemblies
can be added to a whitelist, as a work-around for the clr strict security feature. sp_add_trusted_assembly,
sp_drop_trusted_assembly, and sys.trusted_asssemblies are added to support the white list of trusted
assemblies. For more information, see CLR strict security.
A new, DMF sys.dm_db_log_stats, is introduced to expose summary level attributes and information on
transaction log files; useful for monitoring the health of the transaction log.
Resumable online index rebuild. Resumable online index rebuild allows you to resume an online index rebuild
operation from where it stopped after a failure (such as a failover to a replica or insufficient disk space). You can
also pause and later resume an online index rebuild operation. For example, you might need to temporarily free
up systems resources in order to execute a high priority task or complete the index rebuild in another
maintenance window if the available maintenance windows is too short for a large table. Finally, resumable
online index rebuild does not require significant log space, which allows you to perform log truncation while the
resumable rebuild operation is running. See ALTER INDEX and Guidelines for online index operations.
IDENTITY_CACHE option for ALTER DATABASE SCOPED CONFIGURATION. A new option IDENTITY_CACHE
was added to ALTER DATABASE SCOPED CONFIGURATION T-SQL statement. When this option is set to OFF , it allows
the Database Engine to avoid gaps in the values of identity columns in case a server restarts unexpectedly or
fails over to a secondary server. See ALTER DATABASE SCOPED CONFIGURATION.
SQL Server now offers graph database capabilities to model more meaninginful relationship-oriented data. This
includes new CREATE TABLE syntax for creating node and edge tables, and the keyword MATCH for queries. For
more information, see Graph Processing with SQL Server 2017.
A new generation of query processing improvements that will adapt optimization strategies to your application
workload’s runtime conditions. For this first version of the adaptive query processing feature family, we have
three new improvements: batch mode adaptive joins, batch mode memory grant feedback, and
interleaved execution for multi-statement table valued functions. See Adaptive query processing in SQL
databases.
Automatic tuning is a database feature that provides insight into potential query performance problems,
recommend solutions, and automatically fix identified problems. Automatic tuning in SQL Server, notifies you
whenever a potential performance issue is detected, and lets you apply corrective actions, or lets the Database
Engine automatically fix performance problems. For more information, see Automatic tuning.
PERFORMANCE ENHANCEMENT FOR NON CLUSTERED INDEX BUILD ON MEMORY-OPTIMIZED TABLES.
Performance of bwtree (non-clustered) index rebuild for MEMORY_OPTIMIZED tables during database recovery
has been significantly optimized. This improvement substantially reduces the database recovery time when non-
clustered indexes are used.
sys.dm_os_sys_info has three new columns: socket_count, cores_per_socket, numa_node_count. This is useful
when you run your server in a VM, as exceding NUMA can lead overcommited hosts that in the end transforms
to performance issues.
A new column modified_extent_page_count, is introduced in sys.dm_db_file_space_usage to track differential
changes in each database file of the database. The new column modified_extent_page_count allows you to build
smart backup solution, which performs differential backup if percentage changed pages in the database is below
a threshold (say 70-80%) else perform full database backup.
SELECT INTO … ON FileGroup - SELECT INTO now supports loading a table into a filegroup other than a default
filegroup of the user using the ON keyword support added in SELECT INTO TSQL syntax.
Tempdb Setup Improvements - The setup allows specifying initial tempdb file size up to 256 GB (262,144 MB)
per file with a warning to customers if the file size is set to value greater than 1 GB and if IFI is not enabled. It is
important to understand the implication of not enabling instant file initialization (IFI) where setup time can
increase exponentially depending on the initial size of tempdb data file specified. IFI is not applicable to
transaction log size so specifying larger value of transaction log can invariably increase the setup time while
starting up tempdb during setup irrespective of the IFI setting for SQL Server service account.
A new dmv sys.dm_tran_version_store_space_usage is introduced to track version store usage per database.
This new dmv is useful in monitoring tempdb for version store usage for you to proactively plan tempdb sizing
based on the version store usage requirement per database without any performance toll or overheads of
running it on production servers.
A new DMF sys.dm_db_log_info is introduced to expose the VLF information similar to DBCC LOGINFO to
monitor, alert, and avert potential transaction log issues caused due to number of VLFs, VLF size or shrinkfile
issues experienced by customers.
Improved Backup performance for small databases on high end servers - While performing backup of databases
in SQL Server, the backup process requires multiple iterations of buffer pool to drain the on-going I/Os. As a
result, the backup time is not just the function of database size but also a function of active buffer pool size. In
SQL Server 2017, the backup is optimized to avoid multiple iterations of buffer pool resulting in dramatic gains
in backup performance for small to medium databases. The performance gain reduces as the database size
increases as the pages to backup and backup IO takes more time compared to iterating buffer pool.
Query Store now tracks wait stats summary information. Tracking wait stats categories per query in Query Store
enables the next level of performance troubleshooting experience, providing, even more, insight into the
workload performance and its bottlenecks while preserving the key Query Store advantages.
System-versioned temporal tables now support CASCADE DELETE and CASCADE UPDATE.
Indirect checkpoint performance improvements.
Cluster-less Availability Groups support added.
Minimum Replica Commit Availability Groups setting added.
Availability Groups can now work across Windows-Linux to enable cross-OS migrations and testing.
Temporal Tables Retention Policy support added,
New DMV SYS.DM_DB_STATS_HISTOGRAM
Online non-clustered columnstore index build and rebuild support added
sys.dm_db_stats_histogram (Transact-SQL) is added for examining statistics.
The Database Tuning Advisor (DTA) released with SQL Server Management Studio version 16.4, when analyzing
SQL Server 2016 and later, has additional options.
Improved performance. For more information, see Performance Improvements using Database Engine
Improved performance. For more information, see Performance Improvements using Database Engine
Tuning Advisor (DTA) recommendations.
The -fc option for allowing recommendations of columnstore indexes. For more information, see DTA
Utility and Columnstore index recommendations in Database Engine Tuning Advisor (DTA).
The -iq option for allowing the DTA to review a workload from the Query Store. For more information,
see Tuning Database Using Workload from Query Store.
For In-Memory functionality, additional enhancements to memory-optimized tables and natively compiled
functions are available. For code samples that illustrate these enhancements, see Optimize JSON processing
with in-memory OLTP.
Support for computed columns in memory-optimized tables, including indexes on computed columns.
Full support for JSON functions in natively compiled modules, and in check constraints.
CROSS APPLY operator in natively compiled modules.
New string functions CONCAT_WS, TRANSLATE, and TRIM are added.
The WITHIN GROUP clause is now supported for the STRING_AGG function.
Two new Japanese collation families (Japanese_Bushu_Kakusu_140 and Japanese_XJIS_140) were added, and
the collation option Variation-selector-sensitive (_VSS) was added for use in these new Japanese collations. Also,
all of the new collations automatically support supplementary characters without needing to specify the _SC
option. For more detail see Collation and Unicode Support
New bulk access options (BULK INSERT and OPENROWSET(BULK...)) enable access data directly from a file
specified as CSV format, and from files stored in Azure Blob storage through the new BLOB_STORAGE option of
EXTERNAL DATA SOURCE.
Database COMPATIBILITY_LEVEL 140 has been added. Customers running in this level will get the latest
language features and query optimizer behaviors. This includes changes in each pre-release version Microsoft
releases.
Improvements to the way incremental statistics update thresholds are computed (140 compatibility mode
required).
sys.dm_exec_query_statistics_xml is added.
We have made several performance and language enhancements to Memory-Optimized objects:
sp_spaceused is now supported for memory-optimized tables.
sp_rename is now supported for memory-optimized tables and natively compiled T-SQL modules.
CASE expressions are now supported for natively compiled T-SQL modules.
The limitation of 8 indexes on memory-optimized tables has been eliminated.
TOP (N) WITH TIES is now supported in natively compiled T-SQL modules.
ALTER TABLE against memory-optimized tables is now usually substantially faster.
Transaction log redo of memory-optimized tables is now done in parallel. This bolsters faster recovery
times and significantly increases the sustained throughput of AlwaysOn availability group configuration.
Memory-optimized filegroup files can now be stored on Azure Storage. Backup/Restore of memory-
optimized files on Azure Storage is also available now.
Clustered Columnstore Indexes now support LOB columns (nvarchar(max), varchar(max), varbinary(max)).
The STRING_AGG aggregate function has been added.
New Permissions: DATABASE SCOPED CREDENTIAL is now a class of securable, supporting CONTROL , ALTER ,
REFERENCES , TAKE OWNERSHIP , and VIEW DEFINITION permissions. ADMINISTER DATABASE BULK OPERATIONS , which is
restricted to SQL Database, is now visible in sys.fn_builtin_permissions .
The sys.dm_os_host_info DMV is added to provide operating system information for both Windows and Linux.
The database roles are created with R Services for managing permissions associated with packages. For more
information, see R Package management for SQL Server.
What's new in Database Engine - SQL Server 2016
11/20/2017 • 23 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
This topic summarizes the enhancements introduced in the SQL Server 2017 release of the SQL Server Database
Engine. The new features and enhancements increase the power and productivity of architects, developers, and
administrators who design, develop, and maintain data storage systems.
To review what is new in the other SQL Server components, see What's New in SQL Server 2016.
NOTE
SQL Server 2016 is a 64-bit application. 32-bit installation is discontinued, though some elements run as 32-bit components.
Try it out
To download SQL Server 2016, go to Evaluation Center .
Have an Azure account? Then go Here to spin up a Virtual Machine with SQL Server 2017 already installed.
NOTE
For the current release notes, see SQL Server 2016 Release Notes.
Now when you execute an ALTER TABLE statement on a memory-optimized table, only the metadata changes are
written to the log. This greatly reduces log IO. Also, most ALTER TABLE scenarios now run in parallel, which can
greatly shorten the duration of the statement.
For non-parallel exceptions, including LOBs, see Altering Memory-Optimized Tables.
St a t i st i c s
Statistics for memory-optimized tables are now updated automatically. In addition, sampling is now a supported
method to collect statistics, allowing you to avoid the more expensive fullscan method.
P a r a l l e l a n d h e a p sc a n fo r m e m o r y - o p t i m i z e d t a b l e s
Memory-optimized tables, and indexes on memory-optimized tables, now support parallel scan. This improves the
performance of analytical queries.
In addition, heap scan is supported, and can be performed in parallel. In the case of a memory-optimized table, a
heap scan refers to scanning all the rows in a table using the in-memory heap data structure used for storing the
rows. For a full table scan, heap scan is more efficient than using an index.
T r a n sa c t - SQ L I m p r o v e m e n t s fo r m e m o r y - o p t i m i z e d t a b l e s
There are several Transact-SQL elements that were not supported for memory-optimized tables in SQL Server
2014, which are now supported in SQL Server 2016:
UNIQUE constraints and indexes are supported.
FOREIGN KEY references between memory-optimized tables are supported.
These foreign keys can reference only a primary key, and cannot reference a unique key.
CHECK constraints are supported.
A non-unique index can allow NULL values in its key.
TRIGGERs are supported on memory-optimized tables.
Only AFTER triggers are supported. INSTEADOF triggers are not supported.
Any trigger on a memory-optimized table must use WITH NATIVE_COMPILATION.
Full support for all SQL Server code pages and collations with indexes and other artifacts in memory-
optimized tables and natively compiled T-SQL modules.
Support for Altering Memory-Optimized Tables:
ADD and DROP indexes. Change bucket_count of hash indexes.
Make schema changes: add/drop/alter columns; add/drop constraint.
A memory-optimized table can now have several columns whose combined lengths are longer than the
length of the 8060 byte page. An example is a table that has three columns of type nvarchar(4000) . In such
examples, some columns are now stored off-row. Your queries are blissfully unaware of whether a column is
on-row or off-row.
LOB (large object) types varbinary(max) , nvarchar(max) , and varchar(max) are now supported in memory-
optimized tables.
For overall information, see:
Transact-SQL Constructs Not Supported by In-Memory OLTP
Unsupported SQL Server Features for In-Memory OLTP
T r a n sa c t - SQ L I m p r o v e m e n t s fo r n a t i v e l y c o m p i l e d m o d u l e s
There are some Transact-SQL elements that were not supported for natively compiled modules in SQL Server
2014, which are now supported in SQL Server 2016:
Query constructs:
UNION and UNION ALL
SELECT DISTINCT
OUTER JOIN
Subqueries in SELECT
INSERT, UPDATE and DELETE statements can now include the OUTPUT clause.
LOBs can now be used in the following ways in a native proc:
Declaration of variables.
Input parameters received.
Parameters passed into string functions, such as into LTrim or Substring, in a native proc.
Inline (meaning single statement) table-valued functions (TVFs) can now be natively compiled.
Scalar user-defined functions (UDFs) can now be natively compiled.
Increased support for a native proc to call:
Built-in security functions.
Built-in math functions.
Built-in function @@SPID .
EXECUTE AS CALLER is now support, which means the EXECUTE AS clause is no longer required when
creating a natively compiled T-SQL module.
For overall information, see:
Supported Features for Natively Compiled T-SQL Modules
Altering Natively Compiled T-SQL Modules
P e r fo r m a n c e a n d sc a l i n g i m p r o v e m e n t s
There is no longer any limitation on data size. See Estimate Memory Requirements for Memory-Optimized
Tables.
There are now multiple concurrent threads responsible to persist to disk the changes to memory-optimized
tables.
Parallel plan support for Accessing Memory-Optimized Tables Using Interpreted Transact-SQL.
En h a n c e m e n t s i n SQ L Se r v e r M a n a g e m e n t St u d i o
The Determining if a Table or Stored Procedure Should Be Ported to In-Memory OLTP no longer requires the
configuration of data collectors or management data warehouse. The report can now run directly on a
production database.
PowerShell Cmdlet for Migration Evaluation for evaluating the migration fitness of multiple objects in a SQL
Server database.
Generate migration checklists by right-clicking on a database, and selecting Tasks > Generate In-Memory
OLTP migration checklists.
C r o ss- fe a t u r e su p p o r t
Support for using temporal system-versioning with In-Memory OLTP. For more information, see System-
Versioned Temporal Tables with Memory-Optimized Tables
Query store support for natively compiled code from In-Memory OLTP workloads. For more information,
see Using the Query Store with In-Memory OLTP.
Row-Level Security in Memory-Optimized Tables
Using Multiple Active Result Sets (MARS) connections can now access memory-optimized tables and
natively compiled stored procedures.
Transparent Data Encryption (TDE) support. If a database is configured for ENCRYPTION, files in theThe
Memory Optimized Filegroup are now also encrypted.
For more information, see In-Memory OLTP (In-Memory Optimization).
Query Optimizer
Co m pat i bi l i t y Level Gu ar an t ees
When you upgrade your database to SQL Server 2016, there will be no plan changes seen if you remain at the
older compatibility levels that you were using (for example, 120 or 110). New features and improvements related
to query optimizer, will be available only under latest compatibility level.
T rac e Flag 4 19 9
In general, you do not need to use trace flag 4199 in SQL Server 2016 since most of the query optimizer behaviors
controlled by this trace flag are enabled unconditionally under the latest compatibility level (130) in SQL Server
2016.
N e w R e fe r e n t i a l I n t e g r i t y O p e r a t o r
A table can reference a maximum of 253 other tables and columns as foreign keys (outgoing references). SQL
Server 2016 increases the limit for the number of other table and columns that can reference columns in a single
table (incoming references), from 253 to 10,000. For restrictions, see Create Foreign Key Relationships. A new
referential integrity operator is introduced (under compatibility level 130), which performs the referential integrity
checks in place. This improves overall performance for UPDATE and DELETE operations, on tables that have a large
number of incoming references, thereby making it feasible to have large number of incoming references. For more
information, see Query Optimizer Additions in SQL Server 2016
P a r a l l e l u p d a t e o f sa m p l e d st a t i st i c s
Data sampling to build statistics is now done in parallel (under compatibility level 130), to improve the
performance of statistics collection. For more information, see Update Statistics.
Sublinear threshold for update of statistics
Automatic update of statistics is now more aggressive on large tables (under compatibility level 130). The threshold
to trigger auto-update of statistics is 20%, starting SQL Server 2016, for larger tables, this threshold will start
decreasing (still a percentage) as the number of rows increase in the table. You will no longer need to set trace flag
2371 to reduce the threshold.
O t h er en h an c em en t s
The Insert in an Insert-select statement is multi-threaded or can have a parallel plan (under compatibility level 130).
To get a parallel plan, INSERT … SELECT statement must use the TABLOCK hint. For more information, see Parallel
Insert Select
Live Query Statistics
Management Studio provides the ability to view the live execution plan of an active query. This live query plan
provides real-time insights into the query execution process as the controls flow from one query plan operator to
another. For more information, see Live Query Statistics.
Query Store
Query store is a new feature that provides DBAs with insight on query plan choice and performance. It simplifies
performance troubleshooting by enabling you to quickly find performance differences caused by changes in query
plans. The feature automatically captures a history of queries, plans, and runtime statistics, and retains these for
your review. It separates data by time windows, allowing you to see database usage patterns and understand when
query plan changes happened on the server. The query store presents information by using a Management Studio
dialog box, and lets you force the query to one of the selected query plans. For more information, see Monitoring
Performance By Using the Query Store.
Temporal Tables
SQL Server 2016 now supports system-versioned temporal tables. A temporal table is a new type of table that
provides correct information about stored facts at any point in time. Each temporal table consists of two tables
actually, one for the current data and one for the historical data. The system ensures that when the data changes in
the table with the current data the previous values are stored in the historical table. Querying constructs are
provided to hide this complexity from users. For more information, see Temporal Tables.
Striped Backups to Microsoft Azure Blob Storage
In SQL Server 2016, SQL Server backup to URL using the Microsoft Azure Blob storage service now supports
striped backups sets using block blobs to support a maximum backup size of 12.8 TB. For examples, see Code
Examples.
File-Snapshot Backups to Microsoft Azure Blob Storage
In SQL Server 2016, SQL Server backup to URL now supports using Azure snapshots to backup databases in which
all database files are stored using the Microsoft Azure Blob storage service. For more information, see File-
Snapshot Backups for Database Files in Azure.
Managed Backup
In SQL Server 2016 SQL Server Managed Backup to Microsoft Azure uses the new block blob storage for backup
files. There are also several changes and enhancements to Managed Backup.
Support for both automated and custom scheduling of backups.
Support backups for system databases.
Support for databases that are using the Simple recovery model.
For more information, see SQL Server Managed Backup to Microsoft Azure
NOTE
For SQL Server 2016, these new managed backup features do not yet have corresponding UI support in SQL Server
Management Studio.
TempDB Database
There are several enhancements to TempDB:
Trace Flags 1117 and 1118 are not required for tempdb anymore. If there are multiple tempdb database files
all files will grow at the same time depending on growth settings. In addition, all allocations in tempdb will
use uniform extents.
By default, setup adds as many tempdb files as the CPU count or 8, whichever is lower.
During setup, you can configure the number of tempdb database files, initial size, autogrowth and directory
placement using the new UI input control on the Database Engine Configuration - TempDB section of SQL
Server Installation Wizard.
The default initial size is 8MB and the default autogrowth is 64MB.
You can specify multiple volumes for tempdb database files. If multiple directories are specified tempdb data
files will be spread across the directories in a round-robin fashion.
Built-in JSON Support
SQL Server 2016 adds built-in support for importing and exporting JSON and working with JSON strings. This
built-in support includes the following statements and functions.
Format query results as JSON, or export JSON, by adding the FOR JSON clause to a SELECT statement. Use
the FOR JSON clause, for example, to delegate the formatting of JSON output from your client applications
to SQL Server. For more info, see Format Query Results as JSON with FOR JSON (SQL Server).
Convert JSON data to rows and columns, or import JSON, by calling the OPENJSON rowset provider
function. Use OPENJSON to import JSON data into SQL Server, or convert JSON data to rows and columns
for an app or service that can't currently consume JSON directly. For more info, see Convert JSON Data to
Rows and Columns with OPENJSON (SQL Server).
The ISJSON function tests whether a string contains valid JSON. For more info, see ISJSON (Transact-SQL)
The JSON_VALUE function extracts a scalar value from a JSON string.For more info, see JSON_VALUE
(Transact-SQL).
The JSON_QUERY function extracts an object or an array from a JSON string. For more info, see
JSON_QUERY (Transact-SQL).
The JSON_MODIFY function updates the value of a property in a JSON string and return the updated JSON
string. For more info, see JSON_MODIFY (Transact-SQL).
PolyBase
PolyBase allows you to use T-SQL statements to access data stored in Hadoop or Azure Blob Storage and query it in
an adhoc fashion. It also lets you query semi-structured data and join the results with relational data sets stored in
SQL Server. PolyBase is optimized for data warehousing workloads and intended for analytical query scenarios.
For more information, see PolyBase Guide.
Stretch Database
Stretch Database is a new feature in SQL Server 2016 that migrates your historical data transparently and securely
to the Microsoft Azure cloud. You can access your SQL Server data seamlessly regardless of whether it’s on-
premises or stretched to the cloud. You set the policy that determines where data is stored, and SQL Server handles
the data movement in the background. The entire table is always online and queryable. And, Stretch Database
doesn't require any changes to existing queries or applications – the location of the data is completely transparent
to the application. For more info, see Stretch Database.
Support for UTF-8
bcp Utility, BULK INSERT, and OPENROWSET now support the UTF-8 code page. For more information, see those
topics and Create a Format File (SQL Server).
New Default Database Size and Autogrow Values
New values for the model database and default values for new databases (which are based on model). The initial
size of the data and log files is now 8 MB. The default auto-growth of data and log files is now 64MB.
Transact-SQL Enhancements
Numerous enhancements support the features described in the other sections of this topic. The following additional
enhancements are available.
The TRUNCATE TABLE statement now permits the truncation of specified partitions. For more information, see
TRUNCATE TABLE (Transact-SQL).
ALTER TABLE (Transact-SQL) now allows many alter column actions to be performed while the table remains
available.
The full-text index DMV sys.dm_fts_index_keywords_position_by_document (Transact-SQL) returns the location
of keywords in documents. This DMV has also been added in SQL Server 2012 SP2 and SQL Server 2014 SP1.
A new query hint NO_PERFORMANCE_SPOOL can prevent a spool operator from being added to query plans.
This can improve performance when many concurrent queries are running with spool operations. For more
information, see Query Hints (Transact-SQL).
The FORMATMESSAGE (Transact-SQL) statement is enhances to accept a msg_string argument.
The maximum index key size for NONCLUSTERED indexes has been increased to 1700 bytes.
New DROP IF syntax is added for drop statements related to AGGREGATE, ASSEMBLY, COLUMN, CONSTRAINT,
DATABASE, DEFAULT, FUNCTION, INDEX, PROCEDURE, ROLE, RULE, SCHEMA, SECURITY POLICY, SEQUENCE,
SYNONYM, TABLE, TRIGGER, TYPE, USER, and VIEW. See individual syntax topics for syntax.
A MAXDOP option has been added to DBCC CHECKTABLE (Transact-SQL), DBCC CHECKDB (Transact-SQL), and
DBCC CHECKFILEGROUP (Transact-SQL) to specify the degree of parallelism.
SESSION_CONTEXT can now be set. Includes the SESSION_CONTEXT (Transact-SQL) function,
CURRENT_TRANSACTION_ID (Transact-SQL) function, and the sp_set_session_context (Transact-SQL)
procedure.
Advanced Analytics Extensions allow users to execute scripts written in a supported language such as R.
Transact-SQL supports R by introducing the sp_execute_external_script (Transact-SQL) stored procedure, and
the external scripts enabled Server Configuration Option. For more information, see SQL Server R Services.
Also to support R, the ability to create an external resource pool. For more information, see CREATE EXTERNAL
RESOURCE POOL (Transact-SQL). New catalog views and DMVs
(sys.resource_governor_external_resource_pools (Transact-SQL) and
sys.dm_resource_governor_external_resource_pool_affinity (Transact-SQL)). Additional arguments are available
for sp_execute_external_script (Transact-SQL) and CREATE WORKLOAD GROUP (Transact-SQL). Additional
columns are added to some of the existing resource governor catalog views and DMVs.
The CREATE USER syntax is enhanced with the ALLOW_ENCRYPTED_VALUE_MODIFICATIONS option to support
the Always Encrypted feature. For more information see Migrate Sensitive Data Protected by Always Encrypted.
The COMPRESS (Transact-SQL) and DECOMPRESS (Transact-SQL) functions convert values into and out of the
GZIP algorithm.
The DATEDIFF_BIG (Transact-SQL) and AT TIME ZONE (Transact-SQL) functions and the sys.time_zone_info
(Transact-SQL) view are added to support date and time interactions.
A credential can now be created at the database level (in addition to the server level credential that was
previously available). For more information, see CREATE DATABASE SCOPED CREDENTIAL (Transact-SQL).
Eight new properties are added to SERVERPROPERTY (Transact-SQL): InstanceDefaultDataPath,
InstanceDefaultLogPath, ProductBuild, ProductBuildType, ProductMajorVersion, ProductMinorVersion,
ProductUpdateLevel, and ProductUpdateReference.
The input length limit of 8,000 bytes for the HASHBYTES (Transact-SQL) function is removed.
New string functions STRING_SPLIT (Transact-SQL) and STRING_ESCAPE (Transact-SQL) are added.
Autogrow options: Trace flag 1117 is replaced 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) and the new is_autogrow_all_files column of sys.filegroups (Transact-
SQL).
Allocation of mixed extents: For user databases, default allocation for the first 8 pages of an object will change
from using mixed page extents to using uniform extents. Trace flag 1118 is replaced with 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), and the new is_mixed_page_allocation_on
column of sys.databases (Transact-SQL).
System View Enhancements
Two new views support row level security. For more information, see sys.security_predicates (Transact-SQL) and
sys.security_policies (Transact-SQL).
Seven new views support the Query Store feature. For more information, see Query Store Catalog Views
(Transact-SQL).
24 new columns are added to sys.dm_exec_query_stats (Transact-SQL) provide information about memory
grants.
Two new query hints (MIN_GRANT_PERCENT and MAX_GRANT_PERCENT) are added to specify memory grants.
See Query Hints (Transact-SQL).
sys.dm_exec_session_wait_stats (Transact-SQL) provides a per session report similar to the server wide
sys.dm_os_wait_stats (Transact-SQL).
sys.dm_exec_function_stats (Transact-SQL) provides execution statistics regarding scalar valued functions.
Beginning with SQL Server 2016, entries in sys.dm_db_index_usage_stats (Transact-SQL) are retained as they
were prior to SQL Server 2008 R2.
Information about statements submitted to an instance of SQL Server can be returned by the new dynamic
management function sys.dm_exec_input_buffer (Transact-SQL).
Two new views support SQL Server R Services: sys.dm_external_script_requests and
sys.dm_external_script_execution_stats.
Security Enhancements
Row-Level Security
Row-level security introduces predicate based access control. It features a flexible, centralized, predicate-based
evaluation that can take into consideration metadata (such as labels) or any other criteria the administrator
determines as appropriate. The predicate is used as a criterion to determine whether or not the user has the
appropriate access to the data based on user attributes. Label based access control can be implemented by using
predicate based access control. For more information, see Row-Level Security.
Always Encrypted
With Always Encrypted, SQL Server can perform operations on encrypted data, and best of all the encryption key
resides with the application inside the customer’s trusted environment and not on the server. Always Encrypted
secures customer data so DBAs do not have access to plain text data. Encryption and decryption of data happens
transparently at the driver level minimizing changes that have to be made to existing applications. For more
information, see Always Encrypted (Database Engine).
Dynamic Data Masking
Dynamic data masking limits sensitive data exposure by masking it to non-privileged users. Dynamic data masking
helps prevent unauthorized access to sensitive data by enabling customers to designate how much of the sensitive
data to reveal with minimal impact on the application layer. It’s a policy-based security feature that hides the
sensitive data in the result set of a query over designated database fields, while the data in the database is not
changed. For more information, see Dynamic Data Masking.
New Permissions
The ALTER ANY SECURITY POLICY permission is available as part of the implementation of row level security.
The ALTER ANY MASK and UNMASK permissions are available as part of the implementation of dynamic data
masking.
The ALTER ANY COLUMN ENCRYPTION KEY, VIEW ANY COLUMN ENCRYPTION KEY, ALTER ANY
COLUMN MASTER KEY DEFINITION, and VIEW ANY COLUMN MASTER KEY DEFINITION permissions are
available as part of the implementation of the Always Encrypted feature.
The ALTER ANY EXTERNAL DATA SOURCE and ALTER ANY EXTERNAL FILE FORMAT permissions are
visible in SQL Server 2016 but only apply to the Analytics Platform System ( SQL Data Warehouse).
The EXECUTE ANY EXTERNAL SCRIPT permissions are available as part of the support for R scripts.
The ALTER ANY DATABASE SCOPED CONFIGURATION permissions is available to authorize the use of
the ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL) statement.
Transparent Data Encryption
Transparent Data Encryption has been enhanced with support for Intel AES-NI hardware acceleration of
encryption. This will reduce the CPU overhead of turning on Transparent Data Encryption.
AES Encryption for Endpoints
The default encryption for endpoints is changed from RC4 to AES.
New Credential Type
A credential can now be created at the database level (in addition to the server level credential that was
previously available). For more information, see CREATE DATABASE SCOPED CREDENTIAL (Transact-SQL).
High Availability Enhancements
SQL Server 2016 Standard Edition now supports Always On Basic Availability Groups. Basic availability groups
provide support for a primary and secondary replica. This capability replaces the obsolete Database Mirroring
technology for high availability. For more information about the differences between basic and advanced
availability groups, see Basic Availability Groups (Always On Availability Groups).
Load-balancing of read-intent connection requests is now supported across a set of read-only replicas. The
previous behavior always directed connections to the first available read-only replica in the routing list. For more
information, see Configure load-balancing across read-only replicas.
The number of replicas that support automatic failover has been increased from two to three.
Group Managed Service Accounts are now supported for Always On Failover Clusters. For more information, see
Group Managed Service Accounts. For Windows Server 2012 R2, an update is required to avoid temporary
downtime after a password change. To obtain the update, see gMSA-based services can't log on after a password
change in a Windows Server 2012 R2 domain.
Always On availability groups supports distributed transactions and the DTC on Windows Server 2016. For more
information, see Support for distributed transactions.
You can now configure Always On availability groups to failover when a database goes offline. This change requires
the setting the DB_FAILOVER option to ON in the CREATE AVAILABILITY GROUP (Transact-SQL) or ALTER
AVAILABILITY GROUP (Transact-SQL) statements.
Always On now supports encrypted databases. The Availability Group wizards now prompt you for a password for
any databases that contain a database master key when you create a new Availability Group or when you add
databases or add replicas to an existing Availability Group.
Two availability groups in two separate Windows Server Failover Clusters (WSFC) can now be combined into a
Distributed Availability Group. For more information, see Distributed Availability Groups (Always On Availability
Groups).
Direct seeding allows a secondary replica to be automatically seeded over the network (rather than manual seeding
that requires a physical backup of the target database to be restored on the secondary). Direct seeding is specified
by setting SEEDING_MODE=AUTOMATIC in the CREATE AVAILABILITY GROUP (Transact-SQL) or ALTER
AVAILABILITY GROUP (Transact-SQL) statements. You must also specify GRANT CREATE ANY DATABASE with
ALTER AVAILABILITY GROUP (Transact-SQL) on each secondary replica that is used with direct seeding.
Performance improvements – The synchronization throughput of availability groups has been increased ~10x
through parallel and faster compression of log blocks on the primary replica, an optimized synchronization
protocol, and parallel decompression and redo of log records on the secondary replica. This increases the freshness
of readable secondaries and reduces database recovery time in case of failover. Note that redo for memory-
optimized tables is not yet parallel in SQL Server 2016.
Replication Enhancements
Replication of memory-optimized tables are now supported. For more information, see Replication to Memory-
Optimized Table Subscribers.
Replication is now supported to Azure SQL Database. For more information, see Replication to SQL Database.
Tools Enhancements
Management Studio
Download the latest SQL Server Management Studio (SSMS)
SQL Server Management Studio supports the Active Directory Authentication Library (ADAL) which is under
development for connecting to Microsoft Azure. This replaces the certificate-based authentication used in SQL
Server 2014 Management Studio.
SQL Server Management Studio installation requires installing .NET 4.6 as a pre-requisite. .NET 4.6 will be
automatically installed by setup when SQL Server Management Studio is installed.
A new query result grid option supports keeping Carriage Return/Line Feed (newline characters) when copying
or saving text from the results grid. Set this from the Tools/Options menu.
SQL Server Management Tools is no longer installed from the main feature tree; for details see Install SQL
Server Management Tools with SSMS.
SQL Server Management Studio installation requires installing .NET 4.6.1 as a pre-requisite. .NET 4.6.1 will be
automatically installed by setup when SQL Server Management Studio is installed.
Upgrade Advisor
SQL Server 2016 Upgrade Advisor Preview is a standalone tool that enables users of prior versions to run a set of
upgrade rules against their SQL Server database to pinpoint breaking and behavior changes and deprecated
features as well as providing help with the adoption of new features such as Stretch Database.
You can download Upgrade Advisor Preview here or you can install it by using the Web Platform Installer.
See Also
What's New in SQL Server 2016
SQL Server 2016 Release Notes
Install SQL Server Management Tools with SSMS
SQL Server Database Engine Backward Compatibility
11/20/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
Topics in the backward compatibility section describe changes in behavior between versions of SQL Server.
TOPIC DESCRIPTION
Deprecated Database Engine Features in SQL Server 2017 Deprecated Database Engine features in the 2017 release.
Deprecated Database Engine Features in SQL Server 2016 Deprecated Database Engine features in the 2016 release.
Discontinued Database Engine Functionality in SQL Server Discontinued Database Engine features in the 2016 release.
2016
Breaking Changes to Database Engine Features in SQL Server Database Engine feature changes that might require changes
2017 to applications.
Breaking Changes to Database Engine Features in SQL Server Database Engine feature changes that might require changes
2016 to applications.
Deprecated Database Engine Features in SQL Server
2017
12/5/2017 • 14 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2017) Azure SQL Database Azure SQL Data Warehouse
Parallel Data Warehouse
This topic describes the deprecated SQL Server Database Engine features that are still available in SQL Server
2017. These features are scheduled to be removed in a future release of SQL Server. Deprecated features should
not be used in new applications.
You can monitor the use of deprecated features by using the SQL Server Deprecated Features Object performance
counter and trace events. For more information, see Use SQL Server Objects.
The value of these counters are also available by executing the following statement:
NOTE
This list is identical to the SQL Server 2016 list. There are no new deprecated or discontinued Database Engine features
announced for SQL Server 2017.
sp_remoteoption sp_remoteoption 73
Set options SET ROWCOUNT for TOP keyword SET ROWCOUNT 109
INSERT, UPDATE,
and DELETE
statements
Table hints HOLDLOCK table hint Use HOLDLOCK with HOLDLOCK table hint 167
without parenthesis. parenthesis. without parenthesis
Backup and restore BACKUP { DATABASE BACKUP { DATABASE BACKUP DATABASE 235
| LOG } TO TAPE | LOG } TO DISK or LOG TO TAPE
Data types Ability to insert null Use a DEFAULT INSERT NULL into 179
values into instead. TIMESTAMP columns
timestamp columns.
Data types 'text in row' table Use varchar(max), Text in row table 9
option nvarchar(max), and option
varbinary(max) data
types. For more
information, see
sp_tableoption
(Transact-SQL).
image
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
sp_bindrule sp_unbindrule 67
sp_unbindrule
DBCC UNPINTABLE
srv_describe
srv_getbindtoken
srv_got_attention
srv_message_handler
srv_paramdata
srv_paraminfo
srv_paramlen
srv_parammaxlen
srv_paramname
srv_paramnumber
srv_paramset
srv_paramsetoutput
srv_paramstatus
srv_paramtype
srv_pfield
srv_pfieldex
srv_rpcdb
srv_rpcname
srv_rpcnumber
srv_rpcoptions
srv_rpcowner
srv_rpcparams
srv_senddone
srv_sendmsg
srv_sendrow
srv_setcoldata
srv_setcollen
srv_setutype
srv_willconvert
srv_wsendmsg
srv_wsendmsg
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
Extended stored sp_addextendedproc Use CLR Integration sp_addextendedproc 94
procedure instead.
programming sp_dropextendedproc sp_dropextendedproc 95
sp_helpextendedproc sp_helpextendedproc 96
Hash algorithms The MD2, MD4, MD5, Use SHA2_256 or Deprecated hash
SHA, and SHA1 SHA2_512. algorithm
algorithms. These are
not available under
compatibility level
130.
Instance options sp_configure option System tables are no sp_configure 'allow 173
'allow updates' longer updatable. updates'
Setting has no effect.
Instance options sp_configure option System tables are no sp_configure 'priority 199
'priority boost' longer updatable. boost'
Setting has no effect.
Use the Windows
start /high …
program.exe option
instead.
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
sys.endpoint_webmet EXT_soap_endpoints
hods
sys.soap_endpoints
sys.soap_endpoints
sp_create_removable sp_create_removable 75
Security The ALTER LOGIN Replaced by the new ALTER LOGIN WITH 230
WITH SET ALTER LOGIN ADD SET CREDENTIAL
CREDENTIAL syntax and DROP
CREDENTIAL syntax
sp_defaultlanguage sp_defaultlanguage 48
REVOKE ALL
Server Configuration c2 audit option common criteria sp_configure 'c2 audit 252
Options compliance enabled mode'
default trace enabled Server Configuration 253
option Option sp_configure 'default
trace enabled'
Extended Events
Microsoft.SQLServe Microsoft.SqlServer
r. .
Management.Smo.S Management.Smo.S
ettings class erver class
Microsoft.SQLServe Microsoft.SqlServer
r.Management. .
Smo.DatabaseOptio Management.Smo.D
ns class atabase class
Microsoft.SqlServer None
.Management.Smo.
DatabaseDdlTrigger
.NotForReplication
property
SQL Server Agent net send notification E-mail notification None None
Table compression The use of the Vardecimal storage Vardecimal storage 200
vardecimal storage format is deprecated. format
format. SQL Server 2017 data
compression,
compresses decimal
values as well as other
data types. We
recommend that you
use data compression
instead of the
vardecimal storage
format.
Table hints Specifying table hints Use WITH. Table hint without 8
without using the WITH
WITH keyword.
TEXTVALID() TEXTVALID 6
expression [AS]
'column_alias'
column_alias =
expression
Transact-SQL Use of #, ## as Use at least one '#' and '##' as the 185
temporary table and additional character. name of temporary
temporary stored tables and stored
procedure names. procedures
Transact-SQL Use of @, @@, or Do not use @ or @@ '@' and names that 186.
@@ as Transact-SQL or names that begin start with '@@' as
identifiers. with @@ as Transact-SQL
identifiers. identifiers
Transact-SQL Use of DEFAULT Do not use the word DEFAULT keyword as 187
keyword as default DEFAULT as a default a default value
value. value.
Transact-SQL The select list of an Use COUNT_BIG (*). Index view select list 2
aggregate indexed without
view must contain COUNT_BIG(*)
COUNT_BIG (*) in 90
compatibility mode
MODIFY FILEGROUP
READWRITE
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
Tools SQL Server Profiler for Use Extended Events SQL Server Profiler None
Trace Capture Profiler embedded in
SQL Server
Management Studio.
Tools SQL Server Profiler for SQL Server SQL Server Profiler None
Trace Replay Distributed Replay
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
fn_trace_getinfo fn_trace_getinfo
fn_trace_gettable fn_trace_gettable
sys.traces sys.traces
sys.trace_events sys.trace_events
sys.trace_event_bindin sys.trace_event_bindin
gs gs
sys.trace_categories sys.trace_categories
sys.trace_columns sys.trace_columns
sys.trace_subclass_val sys.trace_subclass_val
ues ues
NOTE
The cookie OUTPUT parameter for sp_setapprole is currently documented as varbinary(8000) which is the correct
maximum length. However the current implementation returns varbinary(50). If developers have allocated varbinary(50)
the application might require changes if the cookie return size increases in a future release. Though not a deprecation issue
this is mentioned in this topic because the application adjustments are similar. For more information, see sp_setapprole
(Transact-SQL).
See Also
Discontinued Database Engine Functionality in SQL Server 2016
Deprecated Database Engine Features in SQL Server
2016
11/20/2017 • 14 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
This topic describes the deprecated SQL Server Database Engine features that are still available in SQL Server
2016. These features are scheduled to be removed in a future release of SQL Server. Deprecated features should
not be used in new applications.
For SQL Server 2017, see Deprecated Database Engine Features in SQL Server 2017.
You can monitor the use of deprecated features by using the SQL Server Deprecated Features Object performance
counter and trace events. For more information, see Use SQL Server Objects.
The value of these counters are also available by executing the following statement:
sp_remoteoption sp_remoteoption 73
Set options SET ROWCOUNT for TOP keyword SET ROWCOUNT 109
INSERT, UPDATE,
and DELETE
statements
Table hints HOLDLOCK table hint Use HOLDLOCK with HOLDLOCK table hint 167
without parenthesis. parenthesis. without parenthesis
Backup and restore BACKUP { DATABASE BACKUP { DATABASE BACKUP DATABASE 235
| LOG } TO TAPE | LOG } TO DISK or LOG TO TAPE
Data types Ability to insert null Use a DEFAULT INSERT NULL into 179
values into instead. TIMESTAMP columns
timestamp columns.
Data types 'text in row' table Use varchar(max), Text in row table 9
option nvarchar(max), and option
varbinary(max) data
types. For more
information, see
sp_tableoption
(Transact-SQL).
image
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
sp_bindrule sp_unbindrule 67
sp_unbindrule
DBCC UNPINTABLE
srv_describe
srv_getbindtoken
srv_got_attention
srv_message_handler
srv_paramdata
srv_paraminfo
srv_paramlen
srv_parammaxlen
srv_paramname
srv_paramnumber
srv_paramset
srv_paramsetoutput
srv_paramstatus
srv_paramtype
srv_pfield
srv_pfieldex
srv_rpcdb
srv_rpcname
srv_rpcnumber
srv_rpcoptions
srv_rpcowner
srv_rpcparams
srv_senddone
srv_sendmsg
srv_sendrow
srv_setcoldata
srv_setcollen
srv_setutype
srv_willconvert
srv_wsendmsg
srv_wsendmsg
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
Extended stored sp_addextendedproc Use CLR Integration sp_addextendedproc 94
procedure instead.
programming sp_dropextendedproc sp_dropextendedproc 95
sp_helpextendedproc sp_helpextendedproc 96
Instance options sp_configure option System tables are no sp_configure 'allow 173
'allow updates' longer updatable. updates'
Setting has no effect.
Instance options sp_configure option System tables are no sp_configure 'priority 199
'priority boost' longer updatable. boost'
Setting has no effect.
Use the Windows
start /high …
program.exe option
instead.
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
sys.endpoint_webmet EXT_soap_endpoints
hods
sys.soap_endpoints
sys.soap_endpoints
sp_create_removable sp_create_removable 75
Security The ALTER LOGIN Replaced by the new ALTER LOGIN WITH 230
WITH SET ALTER LOGIN ADD SET CREDENTIAL
CREDENTIAL syntax and DROP
CREDENTIAL syntax
sp_defaultlanguage sp_defaultlanguage 48
REVOKE ALL
Server Configuration c2 audit option common criteria sp_configure 'c2 audit 252
Options compliance enabled mode'
default trace enabled Server Configuration 253
option Option sp_configure 'default
trace enabled'
Extended Events
Microsoft.SQLServe Microsoft.SqlServer
r. .
Management.Smo.S Management.Smo.S
ettings class erver class
Microsoft.SQLServe Microsoft.SqlServer
r.Management. .
Smo.DatabaseOptio Management.Smo.
ns class Database class
Microsoft.SqlServer None
.Management.Smo.
DatabaseDdlTrigger
.NotForReplication
property
SQL Server Agent net send notification E-mail notification None None
Table compression The use of the Vardecimal storage Vardecimal storage 200
vardecimal storage format is deprecated. format
format. SQL Server 2017 data
compression,
compresses decimal
values as well as
other data types. We
recommend that you
use data compression
instead of the
vardecimal storage
format.
Table hints Specifying table hints Use WITH. Table hint without 8
without using the WITH
WITH keyword.
TEXTVALID() TEXTVALID 6
expression [AS]
'column_alias'
column_alias =
expression
Transact-SQL Use of #, ## as Use at least one '#' and '##' as the 185
temporary table and additional character. name of temporary
temporary stored tables and stored
procedure names. procedures
Transact-SQL Use of @, @@, or Do not use @ or @@ '@' and names that 186.
@@ as Transact-SQL or names that begin start with '@@' as
identifiers. with @@ as Transact-SQL
identifiers. identifiers
Transact-SQL Use of DEFAULT Do not use the word DEFAULT keyword as 187
keyword as default DEFAULT as a default a default value
value. value.
Transact-SQL The select list of an Use COUNT_BIG (*). Index view select list 2
aggregate indexed without
view must contain COUNT_BIG(*)
COUNT_BIG (*) in 90
compatibility mode
MODIFY FILEGROUP
READWRITE
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
Tools SQL Server Profiler for Use Extended Events SQL Server Profiler None
Trace Capture Profiler embedded in
SQL Server
Management Studio.
Tools SQL Server Profiler for SQL Server SQL Server Profiler None
Trace Replay Distributed Replay
CATEGORY DEPRECATED FEATURE REPLACEMENT FEATURE NAME FEATURE ID
fn_trace_getinfo fn_trace_getinfo
fn_trace_gettable fn_trace_gettable
sys.traces sys.traces
sys.trace_events sys.trace_events
sys.trace_event_bindi sys.trace_event_bindin
ngs gs
sys.trace_categories sys.trace_categories
sys.trace_columns sys.trace_columns
sys.trace_subclass_val sys.trace_subclass_val
ues ues
NOTE
The cookie OUTPUT parameter for sp_setapprole is currently documented as varbinary(8000) which is the correct
maximum length. However the current implementation returns varbinary(50). If developers have allocated varbinary(50)
the application might require changes if the cookie return size increases in a future release. Though not a deprecation issue
this is mentioned in this topic because the application adjustments are similar. For more information, see sp_setapprole
(Transact-SQL).
See Also
Discontinued Database Engine Functionality in SQL Server 2016
Discontinued Database Engine Functionality in SQL
Server 2016
11/20/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
This topic describes the Database Engine features that are no longer available in SQL Server 2017.
Previous Versions
Discontinued Database Engine Functionality in SQL Server 2014
Discontinued Database Engine Functionality in SQL Server 2012
Discontinued Database Engine Functionality in SQL Server 2008
See Also
Deprecated Database Engine Features in SQL Server 2016
Deprecated Features in SQL Server Replication
Breaking Changes to Database Engine Features in
SQL Server 2017
12/5/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2017) Azure SQL Database Azure SQL Data Warehouse
Parallel Data Warehouse
This topic describes breaking changes in the SQL Server 2017 Database Engine. These changes might break
applications, scripts, or functionalities that are based on earlier versions of SQL Server. You might encounter these
issues when you upgrade.
Previous Versions
Breaking Changes to Database Engine Features in SQL Server 2016
Breaking Changes to Database Engine Features in SQL Server 2014
Breaking Changes to Database Engine Features in SQL Server 2012
Breaking Changes to Database Engine Features in SQL Server 2008
See Also
Deprecated Database Engine Features in SQL Server 2016
Discontinued Database Engine Functionality in SQL Server 2016
SQL Server Database Engine Backward Compatibility
ALTER DATABASE Compatibility Level (Transact-SQL)
Breaking Changes to Database Engine Features in
SQL Server 2016
12/19/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
This topic describes breaking changes in the SQL Server 2017 Database Engine and earlier versions of SQL Server.
These changes might break applications, scripts, or functionalities that are based on earlier versions of SQL Server.
You might encounter these issues when you upgrade.
Previous Versions
Breaking Changes to Database Engine Features in SQL Server 2014
Breaking Changes to Database Engine Features in SQL Server 2012
Breaking Changes to Database Engine Features in SQL Server 2008
See Also
Deprecated Database Engine Features in SQL Server 2016
Discontinued Database Engine Functionality in SQL Server 2016
SQL Server Database Engine Backward Compatibility
ALTER DATABASE Compatibility Level (Transact-SQL)
SQL Server 2016 or SQL Server 2017 on Windows improvements in handling some data types and uncommon
operations
New and Recently Updated: Database Engine docs
12/4/2017 • 3 min to read • Edit Online
Nearly every day Microsoft updates some of its existing articles on its Docs.Microsoft.com documentation website.
This article displays excerpts from recently updated articles. Links to new articles might also be listed.
This article is generated by a program that is rerun periodically. Occasionally an excerpt can appear with imperfect
formatting, or as markdown from the source article. Images are never displayed here.
Recent updates are reported for the following date range and subject:
Date range of updates: 2017-09-28 -to- 2017-12-02
Subject area: Database Engine.
Recommendations
If the number of single-use plans take a significant portion of ..!NCLUDE-NotShown--ssDEnoversion--
../../includes/ssdenoversion-md.md)] memory in an OLTP server, and these plans are Ad-hoc plans, use this server
option to decrease memory usage with these objects. To find the number of single-use cached plans, run the
following query:
IMPORTANT
Setting the optimize for ad hoc workloads to 1 affects only new plans; plans that are already in the plan cache are
unaffected. To affect already cached query plans immediately, the plan cache needs to be cleared using [ALTER DATABASE
SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE--../../t-sql/statements/alter-database-scoped-configuration-
transact-sql.md), or ..!NCLUDE-NotShown--ssNoVersion--../../includes/ssnoversion-md.md)] has to restart.
Similar Articles
This section lists very similar articles for recently updated articles in other subject areas, within our public
GitHub.com repository: MicrosoftDocs/sql-docs.
Subject areas which do have new or recently updated articles
New + Updated (3+14): Advanced Analytics for SQL docs
New + Updated (1+0): Analysis Services for SQL docs
New + Updated (87+0): Analytics Platform System for SQL docs
New + Updated (5+4): Connect to SQL docs
New + Updated (0+1): Database Engine for SQL docs
New + Updated (2+2): Integration Services for SQL docs
New + Updated (10+9): Linux for SQL docs
New + Updated (2+4): Relational Databases for SQL docs
New + Updated (4+2): Reporting Services for SQL docs
New + Updated (0+1): Samples for SQL docs
New + Updated (21+0): SQL Operations Studio docs
New + Updated (5+1): Microsoft SQL Server docs
New + Updated (0+1): SQL Server Data Tools (SSDT) docs
New + Updated (1+0): SQL Server Migration Assistant (SSMA) docs
New + Updated (0+1): SQL Server Management Studio (SSMS) docs
New + Updated (0+2): Transact-SQL docs
Subject areas which have no new or recently updated articles
New + Updated (0+0): Data Migration Assistant (DMA) for SQL docs
New + Updated (0+0): ActiveX Data Objects (ADO) for SQL docs
New + Updated (0+0): Data Quality Services for SQL docs
New + Updated (0+0): Data Mining Extensions (DMX) for SQL docs
New + Updated (0+0): Master Data Services (MDS) for SQL docs
New + Updated (0+0): Multidimensional Expressions (MDX) for SQL docs
New + Updated (0+0): ODBC (Open Database Connectivity) for SQL docs
New + Updated (0+0): PowerShell for SQL docs
New + Updated (0+0): Tools for SQL docs
New + Updated (0+0): XQuery for SQL docs
1 min to read •
Edit O nline
Configure Database Engine Instances (SQL Server)
11/20/2017 • 1 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data
Warehouse
Each instance of the Database Engine must be configured to meet the performance and availability requirements
defined for the databases hosted by the instance. The Database Engine includes configuration options that control
behaviors such as resource usage and the availability of features such as auditing or trigger recursion.
Instance Configuration
When a database is deployed into production there is often a service level agreement (SLA) defining areas such as
the levels of performance required from the database and the required availability level of the database. The terms
of the SLA typically drive configuration requirements for the instance.
An instance is usually configured immediately after it has been installed. The initial configuration is usually
determined by the SLA requirements of the types of databases planned to be deployed to the instance. After the
databases have been deployed, the database administrators monitor the performance of the instance and adjust
the configuration settings as needed if the performance metrics show the instance is not meeting the SLA
requirements.
Configuration Tasks
TASK DESCRIPTION TOPIC
Describes the various instance configuration options and how Server Configuration Options (SQL Server)
to view or change these options.
Describes how to view and configure the default locations of View or Change the Default Locations for Data and Log Files
new data and log files in the instance. (SQL Server Management Studio)
Describes how to configure SQL Server to use soft-NUMA. Soft-NUMA (SQL Server)
Describes how to map a TCP/IP port to non-uniform memory Map TCP IP Ports to NUMA Nodes (SQL Server)
access (NUMA) node affinity.
Describes how to enable the Windows Lock Pages In Memory Enable the Lock Pages in Memory Option (Windows)
policy. This policy determines which accounts can use a
process to keep data in physical memory, preventing the
system from paging the data to virtual memory on disk.
See Also
Database Engine Instances (SQL Server)
Business continuity and database recovery - SQL
Server
11/20/2017 • 28 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server (starting with 2016) Azure SQL Database Azure SQL Data
Warehouse Parallel Data Warehouse
This article provides an overview of business continuity solutions for high availability and disaster recovery in SQL
Server.
One common task everyone deploying SQL Server has to account for is making sure that all mission critical SQL
Server instances and the databases within them are available when the business and end users need them, whether
that is 9 to 5 or around the clock. The goal is to keep the business up and running with minimal or no interruption.
This concept is also known as business continuity.
SQL Server 2017 introduces many new features or enhancements to existing ones, some of which are for
availability. The biggest addition to SQL Server 2017 is the support for SQL Server on Linux distributions. For a full
list of the new features in SQL Server 2017, see the topic What's new in SQL Server.
This article is focused on covering the availability scenarios in SQL Server 2017 as well as the new and enhanced
availability features in SQL Server 2017. The scenarios include hybrid ones that will be able to span SQL Server
deployments on both Windows Server and Linux, as well as ones that can increase the number of readable copies
of a database. While this article does not cover availability options external to SQL Server, such as those provided
by virtualization, everything discussed here applies to SQL Server installations inside a guest virtual machine
whether in the public cloud or hosted by anon premises hypervisor server.
IMPORTANT
The SQL Server availability features do not replace the requirement to have a robust, well tested backup and restore strategy,
the most fundamental building block of any availability solution.
High availability
Ensuring that SQL Server instances or database are available in the case of a problem that is local to a data center
or single region in the cloud region is important. This section will cover how the SQL Server availability features can
assist in that task. All of the features described are available both on Windows Server as well as on Linux.
Always on availability groups
Introduced in SQL Server 2012, Always On Availability Groups (availability groups) provide database-level
protection by sending each transaction of a database to another instance, known as a replica, that contains a copy
of that database in a special state. An availability group can be deployed on Standard or Enterprise Editions. The
instances participating in an availability group can be either standalone or Always On Failover Cluster Instances
(FCIs, described in the next section). Since the transactions are sent to a replica as they happen, availability groups
are recommended where there are requirements for lower recovery point and recovery time objectives. Data
movement between replicas can be synchronous or asynchronous, with Enterprise Edition allowing up to three
replicas (including the primary) as synchronous. An availability group has one fully read/write copy of the database
which is on the primary replica, while all secondary replicas cannot receive transactions directly from end users or
applications.
NOTE
Always On is an umbrella term for the availability features in SQL Server and covers both availability groups and FCIs. Always
On is not the name of the availability group feature.
Because availability groups only provide database-level, and not instance-level, protection, anything not captured in
the transaction log or configured in the database will need to manually synchronized for each secondary replica.
Some examples of objects that must be synchronized manually are logins at the instance level, linked servers, and
SQL Server Agent jobs.
An availability group also has another component called the listener, which allows applications and end users to
connect without needing to know which SQL Server instance is hosting the primary replica. Each availability group
would have its own listener. While the implementations of the listener are slightly different on Windows Server
versus Linux, the functionality it provides and how it is used is the same. The picture below shows a Windows
Server-based availability group which is using a Windows Server Failover Cluster (WSFC). An underlying cluster at
the OS layer is required for availability whether it is on Linux or Windows Server. The example shows a simple two
server, or node, configuration where a WSFC is the underlying cluster.
Standard and Enterprise Edition have different maximums when it comes to replicas. An availability group in
Standard Edition, known as a Basic Availability Group, supports two replicas (one primary and one secondary) with
only a single database in the availability group. Enterprise Edition not only allows multiple databases to be
configured in a single availability group, but also can have up to nine total replicas (one primary, eight secondary).
Enterprise edition also provides other optional benefits such as readable secondary replicas, the ability to make
backups off of a secondary replica, and more.
NOTE
Database mirroring, which was deprecated in SQL Server 2012, is not available on the Linux version of SQL Server nor will it
be added. Customers still using database mirroring should start planning to migrate to availability groups, which is the
replacement for database mirroring.
When it comes to availability, availability groups can provide either automatic or manual failover. Automatic
failover can occur if synchronous data movement is configured and the database on the primary and secondary
replica are in a synchronized state. As long as the listener is used and the application uses a later version of .NET
(3.5 with an update, or 4.0 and above), the failover should be handled with minimal to no impact to end users if a
listener is utilized. Failover to make a secondary replica the new primary replica can be configured to be automatic
or manual, and generally is measured in seconds.
The list below highlights some differences with availability groups on Windows Server versus Linux:
Due to differences in the way the underlying cluster works on Linux and Windows Server, all failovers (manual
or automatic) of availability groups are done via the cluster on Linux. On Windows Server-based availability
group deployments, manual failovers must be done via SQL Server. Automatic failovers are handled by the
underlying cluster on both Windows Server and Linux.
In SQL Server 2017, the recommended configuration for availability groups on Linux will be a minimum of three
replicas. This is due to the way that the underlying clustering works. An improved solution for a two replica
configuration will come post-release.
On Linux, the common name used by each listener is defined in DNS and not in the cluster like it is on Windows
Server.
In SQL Server 2017, there are some new features and enhancements to availability groups:
Cluster types
REQUIRED_SECONDARIES_TO_COMMIT
Enhanced Microsoft Distributor Transaction Coordinator (DTC) support for Windows Server-based
configurations
Additional scale out scenarios for read only databases (described later in this article)
A l w a y s o n a v a i l a b i l i t y g r o u p c l u st e r t y p e s
The built-in availability form of clustering in Windows Server is enabled via a feature named Failover Clustering. It
allows you to build a WSFC to be used with an availability group or FCI. Integration for availability groups and FCIs
is provided by a cluster-aware resource DLLs shipped by SQL Server.
Each supported Linux distribution ships its own version of the Pacemaker cluster solution. SQL Server 2017 on
Linux supports the use of Pacemaker. Pacemaker is an open stack solution that each distribution can then integrate
with their stack. While the distributions ship Pacemaker, it is not as integrated as the Failover Clustering feature in
Windows Server.
A WSFC and Pacemaker are more similar than different. Both provide a way to take individual servers and combine
them in a configuration to provide availability, and have concepts of things like resources, constraints (even if
implemented differently), failover, and so on. To support Pacemaker for both availability group and FCI
configurations including things like automatic failover, Microsoft provides the mssql-server-ha package, which is
similar to, but not exactly the same as, the resource DLLs in a WSFC, for Pacemaker. One of the differences between
a WSFC and Pacemaker is that there is no network name resource in Pacemaker, which is the component that helps
to abstract the name of the listener (or the name of the FCI) on a WSFC. DNS provides that name resolution on
Linux.
Because of the difference in the cluster stack, some changes needed to be made for availability groups because SQL
Server has to handle some of the metadata that is natively handled by a WSFC. The most [!IMPORTANT] change is
the introduction of a cluster type for an availability group. This is stored in sys.availability_groups in the
cluster_type and cluster_type_desc columns. There are three cluster types:
WSFC
External
None
All availability groups that require availability must use an underlying cluster, which in the case of SQL Server 2017
means a WSFC or Pacemaker. For Windows Server-based availability groups that use an underlying WSFC, the
default cluster type is WSFC and does not need to be set. For Linux-based availability groups, when creating the
availability group, the cluster type must be set to External. The integration with Pacemaker is configured after the
availability group is created, whereas on a WSFC, it is done at creation time.
A cluster type of None can be used with both Windows Server and Linux availability groups. Setting the cluster type
to None means that the availability group does not require an underlying cluster. This means SQL Server 2017 is
the first version of SQL Server to support availability groups without a cluster, but the tradeoff is that this
configuration is not supported as a high availability solution.
IMPORTANT
SQL Server 2017 does not allow the ability to change a cluster type for an availability group after it is created. This means
that an availability group cannot be switched from None to External or WSFC, or vice versa.
For those who are only looking to just add additional read only copies of a database, or like what an availability
group provides for migration/upgrades but do not want to be tied to the additional complexity of an underlying
cluster or even the replication, an availability group with a cluster type of None is a perfect solution. For more
information, see the sections Migrations and Upgrades and read-scale.
The screenshot below shows the support for the different kinds of cluster types in SSMS. You must be running
version 17.1 or later. The screenshot below is from version 17.2.
R E Q U I R E D _ SY N C H R O N I Z E D _ SE C O N D A R I E S_ T O _ C O M M I T
SQL Server 2016 increased support for the number of synchronous replicas from two to three in Enterprise Edition.
However, if one secondary replica was synchronized but the other was having a problem, there was no way to
control the behavior to tell the primary to either wait for the misbehaving replica or to allow it to move on. This
means that the primary replica at some point would continue to receive write traffic even though the secondary
replica would not be in a synchronized state, which means that there is data loss on the secondary replica. In SQL
Server 2017, there is now an option to be able to control the behavior of what happens when there are
synchronous replicas named REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT. The option works as
follows:
There are three possible values: 0, 1, and 2
The value is the number of secondary replicas that must be synchronized, which has implications for data loss,
availability group availability, and failover
For WSFCs and a cluster type of None, the default value is 0, and can be manually set to 1 or 2
For a cluster type of External, by default, the cluster mechanism will set this and it can be overridden manually.
For three synchronous replicas, the default value will be 1. On Linux, the value for
REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT is configured on the availability group resource in
the cluster. On Windows, it is set via Transact-SQL.
A value that is higher than 0 ensures higher data protection because if the required number of secondary replicas is
not available, the primary will not be available until that is resolved.
REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT also affects failover behavior since automatic failover
could not occur if the right number of secondary replicas were not in the proper state. On Linux, a value of 0 will
not allow automatic failover, so on Linux, when using synchronous with automatic failover, the value must be set
higher than 0 to achieve automatic failover. 0 on Windows Server is the SQL Server 2016 and earlier behavior.
En h a n c e d M i c r o so ft d i st r i b u t e d t r a n sa c t i o n c o o r d i n a t o r su p p o r t
Before SQL Server 2016, the only way to get availability in SQL Server for applications that require distributed
transactions which use DTC underneath the covers was to deploy FCIs. A distributed transaction can be done in one
of two ways:
A transaction that spans more than one database in the same SQL Server instance
A transaction that spans more than one SQL Server instance or possibly involves a non-SQL Server data source
SQL Server 2016 introduced partial support for DTC with availability groups that covered the latter scenario. SQL
Server 2017 completes the story by supporting both scenarios with DTC.
Another enhancement to DTC support for availability groups is that in SQL Server 2016, enabling support for DTC
to an availability group could only be done when the availability group was created, and could not be added later.
In SQL Server 2017, DTC support can also be added to an availability group after it is created.
NOTE
DTC support can only be configured for databases in Windows Server-based SQL Server instances. If DTC is an requirement
for your application, you must use Windows Server as the OS for your SQL Server deployment, and cannot use Linux.
IMPORTANT
On Linux, SQL Server Agent jobs is not included as part of the installation of SQL Server itself. It is available in the package
mssql-server-Agent jobs which must also be installed to use log shipping.
Arguably the biggest advantage of using log shipping in some capacity is that it accounts for human error. The
application of transaction logs can be delayed. Therefore, if someone issues something like an UPDATE without a
WHERE clause, the standby may not have the change so you could switch to that while you repair the primary
system. While log shipping is easy to configure, switching from the primary to a warm standby, known as a role
change, is always manual. A role change is initiated via Transact-SQL, and like an availability group, all objects not
captured in the transaction log must be manually synchronized. Log shipping also needs to be configured per
database, whereas a single availability group can contain multiple databases. Unlike an availability group or FCI, log
shipping has no abstraction for a role change. Applications must be able to handle this. Techniques such as a DNS
alias (CNAME) could be employed, but there are pros and cons, such as the time it takes for DNS to refresh after the
switch.
Disaster recovery
When your primary availability location experiences a catastrophic event like an earthquake or flood, the business
must be prepared to have its systems come online elsewhere. This section will cover how the SQL Server
availability features can assist with business continuity.
Always on availability groups
One of the benefits of availability groups is that both high availability and disaster recovery can be configured
using a single feature. Without the requirement for ensuring that shared storage is also highly available, it is much
easier to have replicas that are local in one data center for high availability, and remote ones in other data centers
for disaster recovery each with separate storage. Having additional copies of the database is the tradeoff for
ensuring redundancy. An example of an availability group that spans multiple data centers is shown below. One
primary replica is responsible for keeping all secondary replicas synchronized.
Outside of an availability group with a cluster type of none, an availability group requires that all replicas are part of
the same underlying cluster whether it is a WSFC or Pacemaker. This means that in the picture above, the WSFC is
stretched to work in two different data centers which adds complexity. regardless of the platform (Windows Server
or Linux). Stretching clusters across distance adds complexity. Introduced in SQL Server 2016, a distributed
availability group allows an availability group to span availability groups configured on different clusters. This
decouples the requirement to have the nodes all participate in the same cluster, which makes configuring disaster
recovery much easier. For more information on distributed availability groups, see Distributed availability groups.
Log shipping
Log shipping is one of the oldest methods of providing disaster recovery for SQL Server databases. Log shipping is
often used in conjunction with availability groups and FCIs to provide cost-effective and simpler disaster recovery
where other options may be challenging due to environment, administrative skills, or budget. Similar to the high
availability story for log shipping, many environments will delay the loading of a transaction log to account for
human error.
Finally, availability groups with a cluster type of None can also be used for migration or upgrading. You cannot mix
and match cluster types in a typical availability group configuration, so all replicas would need to be a type of None.
A distributed availability group can be used to span availability groups configured with different cluster types. This
method is also supported across the different OS platforms.
All variants of availability groups for migrations and upgrades allow the most time consuming portion of the work
to be done over time – data synchronization. When it comes time to initiate the switch to the new configuration, the
cutover will be a brief outage versus one long period of downtime where all the work, including data
synchronization, would need to be completed.
Availability groups can provide minimal downtime during patching of the underlying OS by manually failing over
the primary to a secondary replica while the patching is being completed. From an operating system perspective,
doing this would be more common on Windows Server since often, but not always, servicing the underlying OS
may require a reboot. Patching Linux sometimes needs a reboot, but it can be infrequent.
Patching SQL Server instances participating in an availability group can also minimize downtime depending on
how complex the availability group architecture is. To patch servers participating in an availability group, a
secondary replica is patched first. Once the right number of replicas are patched, the primary replica is manually
failed over to another node to do the upgrade. Any remaining secondary replicas at that point can be upgraded,
too.
Always on failover cluster instances
FCIs on their own cannot assist with a traditional migration or upgrade; an availability group or log shipping would
have to be configured for the databases in the FCI and all other objects accounted for. However, FCIs under
Windows Server are still a popular option for when the underlying Windows Servers need to be patched. A manual
failover can be initiated, which means a brief outage instead of having the instance completely unavailable for the
entire time Windows Server is being patched. An FCI can be upgraded in place to SQL Server 2017. For
information, see Upgrade a SQL Server Failover Cluster Instance.
Log shipping
Log shipping is still a popular option to both migrate and upgrade databases. Similar to availability groups, but this
time using the transaction log as the synchronization method, the data propagation can be started well in advance
of the server switch. At the time of the switch, once all traffic is stopped at the source, a final transaction log would
need to be taken, copied, and applied to the new configuration. At that point, the database can be brought online.
Log shipping is often more tolerant of slower networks, and while the switch may be slightly longer than one done
using an availability group or a distributed availability group, it is usually measured in minutes – not hours, days, or
weeks.
Similar to availability groups, log shipping can provide a way to switch to another server in the event of patching.
Other SQL Server deployment methods and availability
There are two other deployment methods for SQL Server on Linux: containers and using Azure (or another public
cloud provider). The general need for availability as presented throughout this paper exists regardless of how SQL
Server is deployed. These two methods have some special considerations when it comes to making SQL Server
highly available.
Containers using Docker are a new way of deploying SQL Server, either for Windows Server or Linux. A container is
a complete image of SQL Server that is ready to run. However, there is currently no native support for clustering,
and thus, direct high availability or disaster recovery. Currently, the options to make SQL Server databases available
using containers would be log shipping and backup and restore. While an availability group with a cluster type of
None can be configured, as noted earlier, it is not considered a true availability configuration. Microsoft is looking
at ways to enable availability groups or FCIs using containers.
If you are using containers today, if the container is lost, depending on the container platform, it can be deployed
again and attached to the shared storage that was used. Some of this mechanism is provided by the container
orchestrator. While this does provide some resiliency, there will be some downtime associated with database
recovery and is not truly highly available as it would be if using an availability group or FCI.
Linux IaaS virtual machines can be deployed with SQL Server installed using Azure. As with on premises-based
installations, a supported installation requires the use of STONITH (Shoot the Other Node in the Head) which is
external to Pacemaker itself. STONITH is provided via fencing availability agents. Some distributions ship them as
part of the platform, others rely on external hardware and software vendors. Check with your preferred Linux
distribution to see what forms of STONITH are provided so that a supported solution can be deployed in the public
cloud.
If an availability group is configured with a cluster type of None, it can span Windows Server and Linux as well as
multiple Linux distributions. Since this is not a true high availability configuration, it should not be used for mission
critical deployments, but for read-scale or migration/upgrade scenarios.
Log shipping
Since log shipping is just based on backup and restore, and there are no differences in the databases, file structures,
etc., for SQL Server on Windows Server versus SQL Server on Linux. This means that log shipping can be
configured between a Windows Server-based SQL Server installation and a Linux one as well as between
distributions of Linux. Everything else remains the same. The only caveat is that log shipping, just like an availability
group, cannot work when the source is at a higher SQL Server major version against a target that is at a lower
version of SQL Server.
read-scale
Since their introduction in SQL Server 2012, secondary replicas have had the ability to be used for read-only
queries. There are two ways that can be achieved with an availability group: by allowing direct access to the
secondary as well as configuring read only routing which requires the use of the listener. SQL Server 2016
introduced the ability to load balance read-only connections via the listener using a round robin algorithm,
allowing read-only requests to be spread across all readable replicas.
NOTE
Readable secondary replicas is a feature only in Enterprise Edition, and each instance hosting a readable replica would need a
SQL Server license.
Scaling readable copies of a database via availability groups was first introduced with distributed availability
groups in SQL Server 2016. This would allow companies to have read-only copies of the database not only locally,
but regionally and globally with a minimal amount of configuration and reduce network traffic and latency by
having queries executed locally. Each primary replica of an availability group can seed two other availability groups
even if it is not the fully read/write copy, so each distributed availability group can support up to 27 copies of the
data that are readable.
Starting with SQL Server 2017, It is possible to create a near-real time, read-only solution with availability groups
configured with a cluster type of None. If the goal is to use availability groups for readable secondary replicas and
not availability, doing this removes the complexity of using a WSFC or Pacemaker, and gives the readable benefits
of an availability group in a simpler deployment method.
The only major caveat is that due to no underlying cluster with a cluster type of None, configuring read only
routing is a little different. From a SQL Server perspective, a listener is still required to route the requests even
though there is no cluster. Instead of configuring a traditional listener, the IP address or name of the primary replica
is used. The primary replica is then used to route the read only requests.
A log shipping warm standby can technically be configured for readable usage by restoring the database WITH
STANDBY. However, because the transaction logs require exclusive use of the database for restoration, it means
that users cannot be accessing the database while that happens. This makes log shipping a less than ideal solution –
especially if near real-time data is required.
One thing that should be noted for all read-scale scenarios with availability groups is that unlike using transactional
replication where all of the data is live, each secondary replica is not in a state where unique indexes can be applied,
the replica is an exact copy of the primary. This means that if any indexes are required for reporting or data needs
to be manipulated, it must be done on the database(s) on the primary replica. If you need that flexibility, replication
is a better solution for readable data.
Summary
Instances and databases of SQL Server 2017 can be made highly available using the same features on both
Windows Server and Linux. Besides standard availability scenarios of local high availability and disaster recovery,
downtime associated with upgrades and migrations can be minimized with the availability features in SQL Server.
Availability groups can also provide additional copies of a database as part of the same architecture to scale out
readable copies. Whether you are deploying a new solution using SQL Server 2017 or considering an upgrade, SQL
Server 2017 has the availability and reliability you require.
Next steps
Availability groups
Failover clusters
Overview of Always On Availability Groups (SQL
Server)
11/20/2017 • 14 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data
Warehouse
For content related to previous versions of SQL Server, see Overview of AlwaysOn Availability Groups (SQL
Server).
This topic introduces the Always On availability groups concepts that are central for configuring and managing one
or more availability groups in SQL Server 2017. For a summary of the benefits offered by availability groups and
an overview of Always On availability groups terminology, see Always On Availability Groups (SQL Server).
An availability group supports a replicated environment for a discrete set of user databases, known as availability
databases. You can create an availability group for high availability (HA) or for read-scale. An HA availability group
is a group of databases that fail over together. A read-scale availability group is a group of databases that are
copied to other instances of SQL Server for read-only workload. An availability group supports one set of primary
databases and one to eight sets of corresponding secondary databases. Secondary databases are not backups.
Continue to back up your databases and their transaction logs on a regular basis.
TIP
You can create any type of backup of a primary database. Alternatively, you can create log backups and copy-only full
backups of secondary databases. For more information, see Active Secondaries: Backup on Secondary Replicas (Always On
Availability Groups).
Each set of availability database is hosted by an availability replica. Two types of availability replicas exist: a single
primary replica. which hosts the primary databases, and one to eight secondary replicas, each of which hosts a set
of secondary databases and serves as a potential failover targets for the availability group. An availability group
fails over at the level of an availability replica. An availability replica provides redundancy only at the database level
—for the set of databases in one availability group. Failovers are not caused by database issues such as a database
becoming suspect due to a loss of a data file or corruption of a transaction log.
The primary replica makes the primary databases available for read-write connections from clients. The primary
replica sends transaction log records of each primary database to every secondary database. This process - known
as data synchronization - occurs at the database level. Every secondary replica caches the transaction log records
(hardens the log) and then applies them to its corresponding secondary database. Data synchronization occurs
between the primary database and each connected secondary database, independently of the other databases.
Therefore, a secondary database can be suspended or fail without affecting other secondary databases, and a
primary database can be suspended or fail without affecting other primary databases.
Optionally, you can configure one or more secondary replicas to support read-only access to secondary databases,
and you can configure any secondary replica to permit backups on secondary databases.
SQL Server 2017 introduces two different architectures for availability groups. Always On availability groups
provide high availability, disaster recovery, and read-scale balancing. These availability groups require a cluster
manager. In Windows, failover clustering provides the cluster manager. In Linux, you can use Pacemaker. The other
architecture is a read-scale availability group. A read scale availability group provides replicas for read-only
workloads but not high availability. In a read-scale availability group there is no cluster manager.
Deploying Always On availability groups for HA on Windows requires a Windows Server Failover Cluster(WSFC).
Each availability replica of a given availability group must reside on a different node of the same WSFC. The only
exception is that while being migrated to another WSFC cluster, an availability group can temporarily straddle two
clusters.
NOTE
For information about availability groups on Linux, see Always On availability group for SQL Server on Linux .
In an HA configuration, a cluster role is created for every availability group that you create. The WSFC cluster
monitors this role to evaluate the health of the primary replica. The quorum for Always On availability groups is
based on all nodes in the WSFC cluster regardless of whether a given cluster node hosts any availability replicas. In
contrast to database mirroring, there is no witness role in Always On availability groups.
NOTE
For information about the relationship of SQL Server Always On components to the WSFC cluster, see Windows Server
Failover Clustering (WSFC) with SQL Server.
The following illustration shows an availability group that contains one primary replica and four secondary replicas.
Up to eight secondary replicas are supported, including one primary replica and two synchronous-commit
secondary replicas.
Availability Databases
To add a database to an availability group, the database must be an online, read-write database that exists on the
server instance that hosts the primary replica. When you add a database, it joins the availability group as a primary
database, while remaining available to clients. No corresponding secondary database exists until backups of the
new primary database are restored to the server instance that hosts the secondary replica (using RESTORE WITH
NORECOVERY). The new secondary database is in the RESTORING state until it is joined to the availability group.
For more information, see Start Data Movement on an Always On Secondary Database (SQL Server).
Joining places the secondary database into the ONLINE state and initiates data synchronization with the
corresponding primary database. Data synchronization is the process by which changes to a primary database are
reproduced on a secondary database. Data synchronization involves the primary database sending transaction log
records to the secondary database.
IMPORTANT
An availability database is sometimes called a database replica in Transact-SQL, PowerShell, and SQL Server Management
Objects (SMO) names. For example, the term "database replica" is used in the names of the Always On dynamic management
views that return information about availability databases: sys.dm_hadr_database_replica_states and
sys.dm_hadr_database_replica_cluster_states. However, in SQL Server Books Online, the term "replica" typically refers to
availability replicas. For example, "primary replica" and "secondary replica" always refer to availability replicas.
Availability Replicas
Each availability group defines a set of two or more failover partners known as availability replicas. Availability
replicas are components of the availability group. Each availability replica hosts a copy of the availability databases
in the availability group. For a given availability group, the availability replicas must be hosted by separate
instances of SQL Server residing on different nodes of a WSFC cluster. Each of these server instances must be
enabled for Always On.
A given instance can host only one availability replica per availability group. However, each instance can be used
for many availability groups. A given instance can be either a stand-alone instance or a SQL Server failover cluster
instance (FCI). If you require server-level redundancy, use Failover Cluster Instances.
Every availability replica is assigned an initial role—either the primary role or the secondary role, which is inherited
by the availability databases of that replica. The role of a given replica determines whether it hosts read-write
databases or read-only databases. One replica, known as the primary replica, is assigned the primary role and
hosts read-write databases, which are known as primary databases. At least one other replica, known as a
secondary replica, is assigned the secondary role. A secondary replica hosts read-only databases, known as
secondary databases.
NOTE
When the role of an availability replica is indeterminate, such as during a failover, its databases are temporarily in a NOT
SYNCHRONIZING state. Their role is set to RESOLVING until the role of the availability replica has resolved. If an availability
replica resolves to the primary role, its databases become the primary databases. If an availability replica resolves to the
secondary role, its databases become secondary databases.
Availability Modes
The availability mode is a property of each availability replica. The availability mode determines whether the
primary replica waits to commit transactions on a database until a given secondary replica has written the
transaction log records to disk (hardened the log). Always On availability groups supports two availability modes
—asynchronous-commit mode and synchronous-commit mode.
Asynchronous-commit mode
An availability replica that uses this availability mode is known as anasynchronous-commit replica. Under
asynchronous-commit mode, the primary replica commits transactions without waiting for
acknowledgement that an asynchronous-commit secondary replica has hardened the log. Asynchronous-
commit mode minimizes transaction latency on the secondary databases but allows them to lag behind the
primary databases, making some data loss possible.
Synchronous-commit mode
An availability replica that uses this availability mode is known as a synchronous-commit replica. Under
synchronous-commit mode, before committing transactions, a synchronous-commit primary replica waits
for a synchronous-commit secondary replica to acknowledge that it has finished hardening the log.
Synchronous-commit mode ensures that once a given secondary database is synchronized with the primary
database, committed transactions are fully protected. This protection comes at the cost of increased
transaction latency.
For more information, see Availability Modes (Always On Availability Groups).
Types of Failover
Within the context of a session between the primary replica and a secondary replica, the primary and secondary
roles are potentially interchangeable in a process known as failover. During a failover the target secondary replica
transitions to the primary role, becoming the new primary replica. The new primary replica brings its databases
online as the primary databases, and client applications can connect to them. When the former primary replica is
available, it transitions to the secondary role, becoming a secondary replica. The former primary databases become
secondary databases and data synchronization resumes.
Three forms of failover exist—automatic, manual, and forced (with possible data loss). The form or forms of
failover supported by a given secondary replica depends on its availability mode, and, for synchronous-commit
mode, on the failover mode on the primary replica and target secondary replica, as follows.
Synchronous-commit mode supports two forms of failover—planned manual failover and automatic
failover, if the target secondary replica is currently synchronized with the avt1. The support for these forms
of failover depends on the setting of the failover mode property on the failover partners. If failover mode is
set to "manual" on either the primary or secondary replica, only manual failover is supported for that
secondary replica. If failover mode is set to "automatic" on both the primary and secondary replicas, both
automatic and manual failover are supported on that secondary replica.
Planned manual failover (without data loss)
A manual failover occurs after a database administrator issues a failover command and causes a
synchronized secondary replica to transition to the primary role (with guaranteed data protection)
and the primary replica to transition to the secondary role. A manual failover requires that both the
primary replica and the target secondary replica are running under synchronous-commit mode, and
the secondary replica must already be synchronized.
Automatic failover (without data loss)
An automatic failover occurs in response to a failure that causes a synchronized secondary replica to
transition to the primary role (with guaranteed data protection). When the former primary replica
becomes available, it transitions to the secondary role. Automatic failover requires that both the
primary replica and the target secondary replica are running under synchronous-commit mode with
the failover mode set to "Automatic". In addition, the secondary replica must already be synchronized,
have WSFC quorum, and meet the conditions specified by the flexible failover policyof the availability
group.
IMPORTANT
SQL Server Failover Cluster Instances (FCIs) do not support automatic failover by availability groups, so any
availability replica that is hosted by an FCI can only be configured for manual failover.
NOTE
Note that if you issue a forced failover command on a synchronized secondary replica, the secondary replica behaves
the same as for a planned manual failover.
Under asynchronous-commit mode, the only form of failover is forced manual failover (with possible data
loss), typically called forced failover. Forced failover is considered a form of manual failover because it can
only be initiated manually. Forced failover is a disaster recovery option. It is the only form of failover that is
possible when the target secondary replica is not synchronized with the primary replica.
For more information, see Failover and Failover Modes (Always On Availability Groups).
Client Connections
You can provide client connectivity to the primary replica of a given availability group by creating an availability
group listener. An availability group listener provides a set of resources that is attached to a given availability
group to direct client connections to the appropriate availability replica.
An availability group listener is associated with a unique DNS name that serves as a virtual network name (VNN),
one or more virtual IP addresses (VIPs), and a TCP port number. For more information, see Availability Group
Listeners, Client Connectivity, and Application Failover (SQL Server).
TIP
If an availability group possesses only two availability replicas and is not configured to allow read-access to the secondary
replica, clients can connect to the primary replica by using a database mirroring connection string. This approach can be
useful temporarily after you migrate a database from database mirroring to Always On availability groups. Before you add
additional secondary replicas, you will need to create an availability group listener the availability group and update your
applications to use the network name of the listener.
Session-Timeout Period
The session-timeout period is an availability-replica property that determines how long connection with another
availability replica can remain inactive before the connection is closed. The primary and secondary replicas ping
each other to signal that they are still active. Receiving a ping from the other replica during the timeout period
indicates that the connection is still open and that the server instances are communicating. On receiving a ping, an
availability replica resets its session-timeout counter on that connection.
The session-timeout period prevents either replica from waiting indefinitely to receive a ping from the other
replica. If no ping is received from the other replica within the session-timeout period, the replica times out. Its
connection is closed, and the timed-out replica enters the DISCONNECTED state. Even if a disconnected replica is
configured for synchronous-commit mode, transactions will not wait for that replica to reconnect and
resynchronize.
The default session-timeout period for each availability replica is 10 seconds. This value is user-configurable, with a
minimum of 5 seconds. Generally, we recommend that you keep the time-out period at 10 seconds or greater.
Setting the value to less than 10 seconds creates the possibility of a heavily loaded system declaring a false failure.
NOTE
In the resolving role, the session-timeout period does not apply because pinging does not occur.
Related Tasks
Getting Started with Always On Availability Groups (SQL Server)
Related Content
Blogs:
Always On - HADRON Learning Series: Worker Pool Usage for HADRON Enabled Databases
SQL Server Always On Team Blogs: The official SQL Server Always On Team Blog
CSS SQL Server Engineers Blogs
Videos:
Microsoft SQL Server Code-Named "Denali" Always On Series,Part 1: Introducing the Next Generation High
Availability Solution
Microsoft SQL Server Code-Named "Denali" Always On Series,Part 2: Building a Mission-Critical High
Availability Solution Using Always On
Whitepapers:
Microsoft SQL Server Always On Solutions Guide for High Availability and Disaster Recovery
Microsoft White Papers for SQL Server 2012
SQL Server Customer Advisory Team Whitepapers
See Also
Availability Modes (Always On Availability Groups)
Failover and Failover Modes (Always On Availability Groups)
Overview of Transact-SQL Statements for Always On Availability Groups (SQL Server)
Overview of PowerShell Cmdlets for Always On Availability Groups (SQL Server)
High Availability Support for In-Memory OLTP databases
Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server)
Creation and Configuration of Availability Groups (SQL Server)
Active Secondaries: Readable Secondary Replicas (Always On Availability Groups)
Active Secondaries: Backup on Secondary Replicas (Always On Availability Groups)
Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server)
The Database Mirroring Endpoint (SQL Server)
11/20/2017 • 4 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data
Warehouse
To participate in Always On availability groups or database mirroring a server instance requires its own, dedicated
database mirroring endpoint. This endpoint is a special-purpose endpoint that is used exclusively to receive
connections from other server instances. On a given server instance, every Always On availability groups or
database mirroring connection to any other server instance uses a single database mirroring endpoint.
Database mirroring endpoints use Transmission Control Protocol (TCP) to send and receive messages between the
server instances participating database mirroring sessions or hosting availability replicas. The database mirroring
endpoint listens on a unique TCP port number.
NOTE
Client connections to a principal server or primary replica do not use the database mirroring endpoint.
NOTE
The database mirroring feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new
development work, and plan to modify applications that currently use database mirroring to use Always On availability
groups instead.
IMPORTANT
If the computer running SQL Server has a firewall, the firewall configuration must allow both incoming and outgoing
connections for the port specified in the endpoint.
For database mirroring and Always On availability groups, authentication and encryption are configured on the
endpoint. For more information, see Transport Security for Database Mirroring and Always On Availability Groups
(SQL Server).
IMPORTANT
Do not reconfigure an in-use database mirroring endpoint. The server instances use each other's endpoints to learn the state
of the other systems. If the endpoint is reconfigured, it might restart, which can appear to be an error to the other server
instances. This is particularly important for automatic failover mode, in which reconfiguring the endpoint on a partner could
cause a failover to occur.
NOTE
If a server instance that is to host an availability replica lacks a database mirroring endpoint, the New Availability
Group Wizard can automatically create a database mirroring endpoint that uses Windows Authentication. For more
information, see Use the Availability Group Wizard (SQL Server Management Studio).
If any server instance is running under a built-in account, such as Local System, Local Service, or Network
Service, or a nondomain account, you must use certificates for endpoint authentication. If you are using
certificates for your database mirroring endpoints, your system administrator must configure each server
instance to use certificates on both outbound and inbound connections.
There is no automated method for configuring database mirroring security using certificates. You will need
to use either CREATE ENDPOINT Transact-SQL statement or the New-SqlHadrEndpoint PowerShell
cmdlet. For more information, see CREATE ENDPOINT (Transact-SQL). For information about enabling
certificate authentication on a server instance, see Use Certificates for a Database Mirroring Endpoint
(Transact-SQL).
Related Tasks
To Configure a Database Mirroring Endpoint
Create a Database Mirroring Endpoint for Windows Authentication (Transact-SQL)
Use Certificates for a Database Mirroring Endpoint (Transact-SQL)
Allow a Database Mirroring Endpoint to Use Certificates for Outbound Connections (Transact-SQL)
Allow a Database Mirroring Endpoint to Use Certificates for Inbound Connections (Transact-SQL)
Specify a Server Network Address (Database Mirroring)
Specify the Endpoint URL When Adding or Modifying an Availability Replica (SQL Server)
Use the Availability Group Wizard (SQL Server Management Studio)
To View Information About the Database Mirroring Endpoint
sys.database_mirroring_endpoints (Transact-SQL)
See Also
Transport Security for Database Mirroring and Always On Availability Groups SQL Server)
Troubleshoot Database Mirroring Configuration (SQL Server)
sys.dm_hadr_availability_replica_states (Transact-SQL)
sys.dm_db_mirroring_connections (Transact-SQL)
About Log Shipping (SQL Server)
11/20/2017 • 5 min to read • Edit Online
THIS TOPIC APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data
Warehouse
SQL Server Log shipping allows you to automatically send transaction log backups from a primary database on a
primary server instance to one or more secondary databases on separate secondary server instances. The
transaction log backups are applied to each of the secondary databases individually. An optional third server
instance, known as the monitor server, records the history and status of backup and restore operations and,
optionally, raises alerts if these operations fail to occur as scheduled.
In this Topic:
Benefits
Terms and Definitions
Log Shipping Overview
Interoperability
Related Tasks
Benefits
Provides a disaster-recovery solution for a single primary database and one or more secondary databases,
each on a separate instance of SQL Server.
Supports limited read-only access to secondary databases (during the interval between restore jobs).
Allows a user-specified delay between when the primary server backs up the log of the primary database
and when the secondary servers must restore (apply) the log backup. A longer delay can be useful, for
example, if data is accidentally changed on the primary database. If the accidental change is noticed quickly,
a delay can let you retrieve still unchanged data from a secondary database before the change is reflected
there.
IMPORTANT
Once the monitor server has been configured, it cannot be changed without removing log shipping first.
backup job
A SQL Server Agent job that performs the backup operation, logs history to the local server and the monitor server,
and deletes old backup files and history information. When log shipping is enabled, the job category "Log Shipping
Backup" is created on the primary server instance.
copy job
A SQL Server Agent job that copies the backup files from the primary server to a configurable destination on the
secondary server and logs history on the secondary server and the monitor server. When log shipping is enabled
on a database, the job category "Log Shipping Copy" is created on each secondary server in a log shipping
configuration.
restore job
A SQL Server Agent job that restores the copied backup files to the secondary databases. It logs history on the local
server and the monitor server, and deletes old files and old history information. When log shipping is enabled on a
database, the job category "Log Shipping Restore" is created on the secondary server instance.
alert job
A SQL Server Agent job that raises alerts for primary and secondary databases when a backup or restore operation
does not complete successfully within a specified threshold. When log shipping is enabled on a database, job
category "Log Shipping Alert" is created on the monitor server instance.
TIP
For each alert, you need to specify an alert number. Also, be sure to configure the alert to notify an operator when an alert is
raised.
Interoperability
Log shipping can be used with the following features or components of SQL Server:
Prerequisites for Migrating from Log Shipping to Always On Availability Groups (SQL Server)
Database Mirroring and Log Shipping (SQL Server)
Log Shipping and Replication (SQL Server)
NOTE
Always On availability groups and database mirroring are mutually exclusive. A database that is configured for one of these
features cannot be configured for the other.
Related Tasks
Upgrading Log Shipping to SQL Server 2016 (Transact-SQL)
Configure Log Shipping (SQL Server)
Add a Secondary Database to a Log Shipping Configuration (SQL Server)
Remove a Secondary Database from a Log Shipping Configuration (SQL Server)
Remove Log Shipping (SQL Server)
View the Log Shipping Report (SQL Server Management Studio)
Monitor Log Shipping (Transact-SQL)
Fail Over to a Log Shipping Secondary (SQL Server)
Fail Over to a Log Shipping Secondary (SQL Server)
Management of Logins and Jobs After Role Switching (SQL Server)
See Also
Overview of Always On Availability Groups (SQL Server)