Skip to content

Latest commit

 

History

History
105 lines (74 loc) · 3.77 KB

File metadata and controls

105 lines (74 loc) · 3.77 KB

title: "@@VERSION (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/20/2018" ms.prod: sql ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw" ms.component: "t-sql|functions" ms.reviewer: "" ms.suite: "sql" ms.technology: t-sql ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords:

  • "@@VERSION"
  • "@@VERSION_TSQL" dev_langs:
  • "TSQL" helpviewer_keywords:
  • "@@VERSION function"
  • "current SQL Server installation information"
  • "versions [SQL Server], @@VERSION"
  • "processors [SQL Server], types" ms.assetid: 385ba80e-7c28-41a5-9cdb-5648f3785983 caps.latest.revision: 40 author: edmacauley ms.author: edmaca manager: craigg monikerRange: ">= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest || >= sql-server-2016 || = sqlallproducts-allversions"

@@Version - Transact SQL Configuration Functions

[!INCLUDEtsql-appliesto-ss2008-all-md]

Returns system and build information for the current installation of [!INCLUDEssNoVersion].

Topic link icon Transact-SQL Syntax Conventions

Syntax

@@VERSION  

Return Types

nvarchar

Remarks

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.

For [!INCLUDEssSDSfull], the following information is returned.

  • Edition- "Microsoft SQL Azure"

  • Product level- "(RTM)"

  • Product version

  • Build date

  • Copyright statement

Note

We are aware of an issue where the product version reported by @@VERSION is incorrect for Azure SQL Database. The version of the SQL Server database engine run by Azure SQL Database 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 Azure SQL Database.

To programmatically determine the engine edition, use SELECT SERVERPROPERTY('EngineEdition'). This query will return '5' for standalone databases and '8' for managed instances in Azure SQL Database.

We will update the documentation once this issue is resolved.

Examples

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';  

Examples: [!INCLUDEssSDWfull] and [!INCLUDEssPDW]

B. Return the current version of [!INCLUDEssDW]

SELECT @@VERSION AS 'SQL Server PDW Version';  

See Also

SERVERPROPERTY (Transact-SQL)