What is the maximum compatibility level of Azure SQL

SQL Server 2022 introduces Parameter Sensitive Plan Optimization (PSPO), a feature that revolutionizes the performance of parameterized queries. With PSPO, the SQL Server stores multiple execution plans for a single query, each tailored to different parameter values. This allows the database engine to dynamically select the most optimized execution plan based on the specific parameter values provided at runtime. By accommodating different data sizes and distributions, PSPO significantly improves query performance, making it particularly valuable for applications dealing with non-uniform data.

If you want to use PSPO, you have to upgrade your compatibility level to 160

As of today;

https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level?view=sql-server-ver16

ProductDatabase Engine versionDefault compatibility level designationSupported compatibility level values
SQL Server 2022 (16.x)16160160, 150, 140, 130, 120, 110, 100
SQL Server 2019 (15.x)15150150, 140, 130, 120, 110, 100
SQL Server 2017 (14.x)14140140, 130, 120, 110, 100
Azure SQL Database12150160, 150, 140, 130, 120, 110, 100
Azure SQL Managed Instance12150160, 150, 140, 130, 120, 110, 100
SQL Server 2016 (13.x)13130130, 120, 110, 100
SQL Server 2014 (12.x)12120120, 110, 100
SQL Server 2012 (11.x)11110110, 100, 90
SQL Server 2008 R2 (10.50.x)10.5100100, 90, 80
SQL Server 2008 (10.0.x)10100100, 90, 80
SQL Server 2005 (9.x)99090, 80
SQL Server 2000 (8.x)88080

How to switch;

-- to view
SELECT name,compatibility_level FROM sys.databases WHERE name='DBname'
-- to set
ALTER DATABASE [DBname] SET COMPATIBILITY_LEVEL = 160