Change Compatibility Level
Compatibility Level in SQL Server controls which version of syntax and optimisation a database uses, and can be adjusted with a simple ALTER DATABASE command.
SQL Server Compatibility Level determines which version of SQL Server syntax, optimiser behaviour and features a database must follow. By setting a specific compatibility level you can:
- Run older T‑SQL code on a newer SQL Server instance without having to modify it.
- Ensure that performance optimisation and planning occur as they did in the version the code was originally written for.
- Gradually migrate a database to a newer version by incrementally raising the compatibility level, so any breaking changes can be tested in a controlled environment.
When the compatibility level is raised, the database gains access to new features and improvements, but it may also be affected by changes in query optimisation and behaviour that could impact existing applications.
You can change the SQL Server Compatibility Level with a SQL command.
Read how in these articles:
Article from the support category: Microsoft SQL Server