| title | @@VERSION (Transact-SQL) | ||||
|---|---|---|---|---|---|
| description | @@VERSION - Transact SQL Configuration Functions | ||||
| author | MikeRayMSFT | ||||
| ms.author | mikeray | ||||
| ms.reviewer | |||||
| ms.date | 03/20/2018 | ||||
| ms.prod | sql | ||||
| ms.prod_service | database-engine, sql-database, synapse-analytics, pdw | ||||
| ms.technology | t-sql | ||||
| ms.topic | reference | ||||
| ms.custom | |||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| dev_langs |
|
||||
| monikerRange | >= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest || >= sql-server-2016 || >= sql-server-linux-2017 || = azuresqldb-mi-current |
[!INCLUDE sql-asdb-asdbmi-asa-pdw]
Returns system and build information for the current installation of [!INCLUDEssNoVersion].
Transact-SQL Syntax Conventions
Note
We are aware of an issue where the product version reported by @@VERSION is incorrect for Azure SQL Database, Azure SQL Managed Instance and Azure Synapse Analytics.
The version of the SQL Server database engine run by Azure SQL Database, Azure SQL Managed Instance and Azure Synapse Analytics is always ahead of the on-premises version of SQL Server, and includes the latest security fixes. This means that the patch level is always on par with or ahead of the on-premises version of SQL Server, and that the latest features available in SQL Server are available in these services.
To programmatically determine the engine edition, use SELECT SERVERPROPERTY('EngineEdition'). This query will return '5' for Azure SQL Database, '8' for Azure SQL Managed Instance, and '6' or '11' for Azure Synapse.
We will update the documentation once this issue is resolved.
@@VERSION
[!INCLUDEsql-server-tsql-previous-offline-documentation]
nvarchar
The @@VERSION results are presented as one nvarchar string. You can use the SERVERPROPERTY (Transact-SQL) function to retrieve the individual property values.
For [!INCLUDEssNoVersion], the following information is returned.
-
[!INCLUDEssNoVersion] version
-
Processor architecture
-
[!INCLUDEssNoVersion] build date
-
Copyright statement
-
[!INCLUDEssNoVersion] edition
-
Operating system version
For [!INCLUDEssSDSfull] and [!INCLUDEssSDSfull], the following information is returned.
-
Edition- "Microsoft SQL Azure"
-
Product level- "(RTM)"
-
Product version
-
Build date
-
Copyright statement
A: Return the current version of [!INCLUDEssNoVersion]
The following example shows returning the version information for the current installation.
SELECT @@VERSION AS 'SQL Server Version'; B. Return the current version of [!INCLUDEssDW]
SELECT @@VERSION AS 'SQL Server PDW Version';