Blog Post

Azure SQL Blog
3 MIN READ

Database compatibility level 170 in Azure SQL Database and SQL database in Microsoft Fabric

theSQLSith's avatar
theSQLSith
Icon for Microsoft rankMicrosoft
Apr 17, 2025

Database compatibility level 170 is now the default for new databases created in Azure SQL Database and SQL database in Microsoft Fabric across all public regions.

The alignment of SQL versions to default compatibility levels are as follows:

  • 100: in SQL Server 2008 and Azure SQL Database
  • 110: in SQL Server 2012 and Azure SQL Database
  • 120: in SQL Server 2014 and Azure SQL Database
  • 130: in SQL Server 2016 and Azure SQL Database
  • 140: in SQL Server 2017and Azure SQL Database
  • 150: in SQL Server 2019 and Azure SQL Database
  • 160: in SQL Server 2022, Azure SQL Database and SQL database in Microsoft Fabric
  • 170: in SQL Server 2025 (Preview), Azure SQL Database and SQL database in Microsoft Fabric

For details about which feature, or features compatibility level 170 enables, please see what is new under database compatibility 170. The Intelligent query processing (IQP) family of features also include multiple features that improve the performance of existing workloads with minimal or no implementation effort.

Once this new database compatibility default goes into effect, if you still wish to use database compatibility level 160 (or lower), please follow the instructions detailed here: View or Change the Compatibility Level of a Database.  For example, you may wish to ensure that new databases created on the same logical server use the same compatibility level as other Azure SQL Databases to ensure consistent query optimization and execution behavior across development, QA and production versions of your databases. With this example in mind, we recommend that any database configuration scripts in use explicitly designate the COMPATIBILITY_LEVEL rather than rely on the defaults, in order to ensure consistent application behavior.

 

For new databases supporting new applications, we recommend using the latest compatibility level, 170. For pre-existing databases running at lower compatibility levels, the recommended workflow for upgrading the query processor to a higher compatibility level is detailed in the article Change the Database Compatibility Mode and Use the Query Store. Note that this article refers to database compatibility level 130 and SQL Server, but the same methodology that is described applies to database compatibility 170 for SQL Server and Azure SQL Database.

 

To determine the current database compatibility level, query the compatibility_level column of sys.databases system catalog view.

 

SELECT [name], compatibility_level FROM sys.databases;

 

So, there may be a few questions that we have not directly answered with this announcement. Maybe questions such as:

 

What do you mean by “database compatibility level 170 is now the default”?
If you create a new database and don’t explicitly designate the COMPATIBILITY_LEVEL, the database compatibility level 170 will be used.

Does Microsoft automatically update the database compatibility level for existing databases?
No. We do not update the database compatibility level for existing databases.  This is up to you as an owner of your database to do at your own discretion. With that said, we highly recommend that you plan on moving to the latest database compatibility level in order to leverage the latest improvements that are enabled with the latest compatibility level.

I created a logical server before 170 was the default database compatibility level.  What impact does this have?
The master database of your logical server will reflect the database compatibility level that was the default when the logical server was created.  New databases created on this logical server with an older compatibility level for the master database will use database compatibility level 170 if the database compatibility level is not explicitly specified.  The master database compatibility cannot be changed without recreating the logical server.  Having master database operating at an older database compatibility level will not impact user database behavior.

 

Would the database compatibility level change to 170 if I restore a database from a point in time backup before the default changed?

No. We will preserve the compatibility level that was in effect when the backup was performed. 

Updated Jun 19, 2025
Version 3.0

7 Comments

  • Zuoken's avatar
    Zuoken
    Copper Contributor

    Is there an update coming for SQL Server Database Project in Visual Studio to allow me to target compatibility level 170? We've created a new Azure SQL Database, but the highest level I can target in Database Settings in my project is 160, even after I've selected Microsoft Azure SQL Database as the target platform. As a result when I try to deploy the dacpac I'm getting this error - "The compatibility level of the target schema 170 is not supported, which may result in undefined behavior. Please upgrade to a later version which supports this compatibility level."

      • CTaylor_Truegility's avatar
        CTaylor_Truegility
        Copper Contributor

        theSQLSith​ - is there any update on when support for compatibility level 170 will be coming to SSDT? The new JSON data type and functions in 170 is great, but using JSON_ARRAYAGG function is causing errors in my build in SSDT.

  • DavJarr's avatar
    DavJarr
    Copper Contributor

    Why doesn’t the article cover what’s new in compat level 170? The linked document for IQP makes no mention of 170 either.

    • theSQLSith's avatar
      theSQLSith
      Icon for Microsoft rankMicrosoft

      Thank you for the feedback. It is appreciated.

       

      We typically provide the additional details regarding "what's new" or what has changed with a new database compatibility level, within the official ALTER DATABASE compatibility level documentation page. The current updates for that page have not been published yet, but that is in progress. We will be updating that page along with the changes for the IQP features over time and they should both be in sync over in the very near future.

       

      We understand that this can be confusing, and we apologize for that as that was not our intent. The purpose of this blog was purposely created to be concise and to communicate that the default database compatibility has changed in Azure SQL Database and SQL database in Microsoft Fabric.

       

      There are several features that are currently in different phases of the preview process, for example, the regular expressions functions, have surpassed their limited preview phase and the documentation for those functions are publicly documented along with the information regarding the use of database compatibility level 170 to take advantage of those functions. 

       

      Please free to reach out to us directly at IntelligentQP@microsoft.com, if you have additional questions or concerns.

      • DavJarr's avatar
        DavJarr
        Copper Contributor

        I appreciate it’s trying to be concise but this announcement of the new default compatibility level is the perfect place to highlight what such a change tangibly means to users, even if that’s just linking to documents with further detail.

         

        If said documents aren’t yet available then I don’t understand why the switchover has been done. It would be better if the change and the documentation could be released closer together, and I’d say ideally you’d actually want the documentation available first.