Sets Transact-SQL and query processing behaviors to be compatible with the specified version of the SQL Server Database Engine. 

EXEC dbo.sp_dbcmptlevel @dbname=N'Database01', @new_cmptlevel=90
ALTER DATABASE Database01
SET COMPATIBILITY_LEVEL = 90
ProductDatabase Engine VersionDefault Compatibility Level DesignationSupported Compatibility Level Values
SQL Server 2019 preview15150150, 140, 130, 120, 110, 100
SQL Server 2017 (14.x)14140140, 130, 120, 110, 100
Azure SQL Database single database/elastic pool12140150, 140, 130, 120, 110, 100
Azure SQL Database managed instance12140150, 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 R210.5100100, 90, 80
SQL Server 200810100100, 90, 80
SQL Server 2005 (9.x)99090, 80
SQL Server 200088080

Sources:

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

https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-dbcmptlevel-transact-sql?view=sql-server-2017

Last modified: July 25, 2019

Author

Comments

Write a Reply or Comment