SDU Tools: SQL Server Version for Compatibility Level

While SQL Server includes an amazing array of built in functions and procedures, one that’s always puzzled me is the lack of a simple function to convert a database compatibility level to a SQL Server version ie: how do you know that 110 was SQL Server 2012?
And so, you don’t need to wait any longer.
One of the tools in our free SDU Tools collection for database developers and DBAs is SQLServerVersionForCompatibilityLevel.
It’s a simple function that takes the compatibility level (an integer), and returns the name of the SQL Server version (a string) as you can see in the main image.
You can see it in action here:
For more information on being an SDU Insider and getting our free tools, eBooks, and more, just visit: http://sdutools.sqldownunder.com .
2018-06-06