For other ALTER DATABASE options, see. For more information about the syntax conventions, see. The following compatibility level values can be configured not all versions supports all of the above listed compatibility level : Product Database Engine Version Compatibility Level Designation Supported Compatibility Level Values SQL Server 2019 preview 15 150 150, 140, 130, 120, 110, 100 SQL Server 2017 14. We do not update database compatibility level for existing databases. This is up to customers to do at their own discretion. With that said, we highly recommend customers plan on moving to the latest compatibility level in order to leverage the latest improvements. If you want to leverage database compatibility level 140 for your database overall, but you have reason to prefer the cardinality estimation model of SQL Server 2012 11. For details about how to assess the performance differences of your most important queries, between two compatibility levels on Azure SQL Database, see. Note that this article refers to compatibility level 130 and SQL Server, but the same methodology applies for moves to 140 for SQL Server and Azure SQL Database. Execute the following query to determine the version of the Database Engine that you are connected to. SELECT SERVERPROPERTY 'ProductVersion' ; Note Not all features that vary by compatibility level are supported on Azure SQL Database. Databases are set to this level unless the model database has a lower compatibility level. When a database is upgraded from any earlier version of SQL Server, the database retains its existing compatibility level, if it is at least minimum allowed for that instance of SQL Server. Upgrading a database with a compatibility level lower than the allowed level, automatically sets the database to the lowest compatibility level allowed. This applies to both system and user databases. The below behaviors are expected for SQL Server 2017 14. Use ALTER DATABASE to change the compatibility level of the database. The new compatibility level setting for a database takes effect when a USE command is issued, or a new login is processed with that database as the default database context. Note A that was created in an earlier version of SQL Server and is upgraded to SQL Server 2016 13. This does not have an impact on the functionality of replication. Upgrading to later service packs and versions of SQL Server will result in the compatibility level of the distribution database to be increased to match that of the master database. Compatibility Levels and SQL Server Upgrades Database compatibility level is a valuable tool to assist in database modernization, by allowing the SQL Server Database Engine to be upgraded, while keeping connecting applications functional status by maintaining the same pre-upgrade database compatibility level. As long as the application does not need to leverage enhancements that are only available in a higher database compatibility level, it is a valid approach to upgrade the SQL Server Database Engine and maintain the previous database compatibility level. For more information on using compatibility level for backward compatibility, see the later in this article. For new development work, or when an existing application requires use of new features, as well as performance improvements done in the query optimizer space, plan to upgrade the database compatibility level to the latest available in SQL Server, and certify your application to work with that compatibility level. For more details on upgrading the database compatibility level, see the later in the article. Tip If an application was tested and certified on a given SQL Server version, then it was implicitly tested and certified on that SQL Server version native database compatibility level. So, database compatibility level provides an easy certification path for an existing application, when using the database compatibility level corresponding to the tested SQL Server version. For more information about differences between compatibility levels, see the appropriate sections later in this article. To upgrade the SQL Server Database Engine to the latest version, while maintaining the database compatibility level that existed before the upgrade and its supportability status, it is recommended to perform static functional surface area validation of the application code in the database, by using the tool DMA. The absence of errors in the DMA tool output, about missing or incompatible functionality, protects application from any functional regressions on the new target version. For more information on the DMA tool, see. Any query plan shape regression as compared to the source SQL Server that occurs in the above conditions will be addressed. Please contact Microsoft Customer Support if this is the case. Using Compatibility Level for Backward Compatibility The database compatibility level setting affects behaviors only for the specified database, not for the entire server. Database compatibility level provides only partial backward compatibility with earlier versions of SQL Server. Tip Because database compatibility level is a database-level setting, an application running on a newer SQL S