SDU Tools: Server Maximum DB Compatibility Level in T-SQL
I like to have my databases at the same database compatibility level as the server, whenever possible. But how do you know the maximum value that’s allowed? We recently added a tool to our free SDU Tools for developers and DBAs to solve this. It’s called ServerMaximumDBCompatibilityLevel.
It’s a simple scalar function that returns the maximum DB compatibility level that’s supported by the server. It takes no parameters.
If you want to know which server version (like 2017 or 2019) that the DB compatibility level represents, you can also combine it with our SQLServerVersionForCompatibilityLevel function.
2020-04-01