This morning, one developer of my team asked me what was the SQL version of one of our production databases to see if he could use newer SQL syntax in a query.
If you use SQL Management Studio you can get the SQL server version in the object explorer of Management Studio.
In this example, the server version is 12.0.2000.8 which could be interpreted as a SQL Server 2014.
But using SELECT @@VERSION you can get a different version
In this example , it seem to be SQL Server 2016.
So physical SQL server and Azure SQL server version number aren’t the same.
But What really matter is the compatibility level which is what you looking for when you want to use newer SQL syntax.
The alignment of SQL versions to default compatibility levels are as follows:
- 100: in SQL Server 2008 and Azure SQL Database
- 110: in SQL Server 2012 and Azure SQL Database
- 120: in SQL Server 2014 and Azure SQL Database
- 130: in SQL Server 2016 and Azure SQL Database
- 140: in SQL Server 2017 and Azure SQL Database