What's new in Database Engine - SQL Server 2016

APPLIES TO: yesSQL Server noAzure SQL Database noAzure SQL Data Warehouse noParallel 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.


SQL Server 2016 (13.x) 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.

  • Have an Azure account? Then go Here to spin up a Virtual Machine with SQL Server 2017 already installed.


For the current release notes, see SQL Server 2016 Release Notes.

SQL Server 2016 Service Pack 1 (SP1)

SQL Server 2016 RTM

This section contains the following subsections:

Columnstore indexes

This release offers improvements for columnstore indexes including updateable nonclustered columnstore indexes, columnstore indexes on in-memory tables, and many more new features for operational analytics.

  • A read-only nonclustered columnstore index is updateable after upgrade. A rebuild of the index is not required to make it updateable.

  • There are performance improvements for analytics queries on columnstore indexes, especially for aggregates and string predicates.

  • DMVs and XEvents have supportability improvements.

For more details, see these topics in the Columnstore Indexes Guide section of Books Online:

Database scoped configurations

The new ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL) statement gives you control of certain configurations for your particular database. The configuration settings affect application behavior.

The new statement is available in both SQL Server 2016 (13.x) and SQL Database.

In-Memory OLTP

Storage format change

The storage format for memory-optimized tables is changed between SQL Server 2014 and 2016. For upgrade and attach/restore from SQL Server 2014, the new storage format is serialized and the database is restarted once during database recovery.

ALTER TABLE is log-optimized, and runs in parallel

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.


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.

Parallel and heap scan for memory-optimized tables

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.

Transact-SQL Improvements for memory-optimized tables

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:

Performance and scaling improvements

Enhancements in SQL Server Management Studio

Cross-feature support

For more information, see In-Memory OLTP (In-Memory Optimization).

Query Optimizer

Compatibility Level Guarantees

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.

Trace Flag 4199

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.

New referential integrity operator

A table can reference a maximum of 253 other tables and columns as foreign keys (outgoing references). SQL Server 2016 (13.x) 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

Parallel update of sampled statistics

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.

Other enhancements

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 (13.x) 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 (13.x), 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 (13.x), 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 (13.x) 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


For SQL Server 2016 (13.x), 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 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 (13.x) 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.

Transact-SQL improvements for natively compiled modules

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:

    • 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:

  • 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:

System View enhancements

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 (13.x) 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

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

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 (12.x)Management Studio.
  • 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.

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