SQL Server Compatibility Level – Impact of Deprecated Features

compatibility-leveldeprecationsql serversql-server-2019

On my SQL Server 2019 machine, I have a database that is running on the lowest supported compatibility level (I believe that's equivalent to SQL Server 2008). I want to switch it to the very highest. Do I need to check for deprecated features first?

This feels like it should be a duplicate, but I've not managed to find anything mentioning both topics.

Best Answer

Not exactly, deprecated features are planned to stop working but discontinued features actually do not work in the later version.

Data migration assistant will be very helpful & also the comment by Martin Smith:

You need to be aware that some code might break due to subsequent breaking changes. e.g. SELECT {d '2023-01-01'} + CAST('08:00:00.000' AS TIME) will execute without errors on a 2008 compat database. Or there are other breaking or behavioural changes that you might encounter when raising compat level

https://learn.microsoft.com/en-us/sql/database-engine/discontinued-database-engine-functionality-in-sql-server?view=sql-server-ver16