@@VERSION - Transact SQL Configuration Functions
Returns system and build information for the current installation of SQL Server.
The Database Engine version numbers for SQL Server and Azure SQL Database are not comparable with each other, and represent internal build numbers for these separate products. The Database Engine for Azure SQL Database is based on the same code base as the SQL Server Database Engine. Most importantly, the Database Engine in Azure SQL Database always has the newest SQL Database Engine bits. For example, version 12 of Azure SQL Database is newer than version 16 of SQL Server.
To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
The @@VERSION results are presented as one nvarchar string. You can use the SERVERPROPERTY (Transact-SQL) function to retrieve the individual property values.
For SQL Server, the following information is returned.
SQL Server version
SQL Server build date
SQL Server edition
Operating system version
For Azure SQL Database and Azure SQL Managed Instance, the following information is returned.
Edition- "Microsoft SQL Azure"
Product level- "(RTM)"
A: Return the current version of SQL Server
The following example shows returning the version information for the current installation.
SELECT @@VERSION AS 'SQL Server Version';
Examples: Azure Synapse Analytics and Analytics Platform System (PDW)
B. Return the current version of Azure Synapse Analytics
SELECT @@VERSION AS 'SQL Server PDW Version';