| title | @@VERSION (Transact-SQL) | ||||
|---|---|---|---|---|---|
| description | Returns SQL Server installation system and build information. | ||||
| author | MikeRayMSFT | ||||
| ms.author | mikeray | ||||
| ms.reviewer | maghan, randolphwest | ||||
| ms.date | 11/25/2025 | ||||
| ms.service | sql | ||||
| ms.subservice | 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 || =fabric || =fabric-sqldb |
[!INCLUDE sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw-fabricsqldb]
The @@VERSION configuration function returns information about the system and [!INCLUDE ssNoVersion] build information.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
Important
The [!INCLUDE ssDE-md] version numbers for [!INCLUDE ssNoVersion] and [!INCLUDE ssazure-sqldb] aren't comparable with each other, and represent internal build numbers for these separate products. For more information, see the Remarks section.
@@VERSION
nvarchar
-
The [!INCLUDE ssDE-md] version numbers for [!INCLUDE ssNoVersion] and [!INCLUDE ssazure-sqldb] aren't comparable with each other, and represent internal build numbers for these separate products. The [!INCLUDE ssDE-md] for [!INCLUDE ssazure-sqldb] is based on the same code base as the [!INCLUDE ssDEnoversion]. Most importantly, the [!INCLUDE ssDE-md] in [!INCLUDE ssazure-sqldb] always has the newest SQL [!INCLUDE ssDE-md] bits. For example, version 12 of [!INCLUDE ssazure-sqldb] is newer than version 16 of [!INCLUDE ssNoVersion].
-
The
@@VERSIONresults appear as one nvarchar string. Use the SERVERPROPERTY function to get the individual property values. -
For [!INCLUDE ssNoVersion], the
@@VERSIONresults include:-
[!INCLUDE ssNoVersion] version
-
Processor architecture
-
[!INCLUDE ssNoVersion] build date
-
Copyright statement
-
[!INCLUDE ssNoVersion] edition
-
Operating system version
The operating system version information comes from the host, virtual machine, or container where [!INCLUDE ssNoVersion] is installed. It doesn't necessarily reflect the retail version of the underlying operating system. For information about querying Windows version information using the WMI Query Language (WQL), see Win32_OperatingSystem class.
-
-
For [!INCLUDE ssazure-sqldb] and [!INCLUDE ssazuremi-md], the
@@VERSIONresults include:-
Edition: "Microsoft SQL Azure"
-
Product level: "(RTM)"
-
Product version
-
Build date
-
Copyright statement
-
The following example shows the version information for an installation of [!INCLUDE sssql25-md]. Depending on the underlying host, virtual machine, or container operating system, the command returns different information.
SELECT @@VERSION AS 'SQL Server Version';-
Windows Server 2019 virtual machine:
Microsoft SQL Server 2025 (RTM) - 17.0.1000.7 (X64) Oct 21 2025 12:05:57 Copyright (C) 2025 Microsoft Corporation Enterprise Developer Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor) -
Windows 11 virtual machine:
Microsoft SQL Server 2025 (RTM) - 17.0.1000.7 (X64) Oct 21 2025 12:05:57 Copyright (C) 2025 Microsoft Corporation Enterprise Developer Edition (64-bit) on Windows 10 Enterprise 10.0 <X64> (Build 26220: ) (VM)In this example, the output doesn't necessarily reflect the retail version of the operating system.
-
Ubuntu Linux 24.04:
Microsoft SQL Server 2025 (RTM) - 17.0.1000.7 (X64) Oct 21 2025 12:05:57 Copyright (C) 2025 Microsoft Corporation Enterprise Developer Edition (64-bit) on Linux (Ubuntu 24.04.3 LTS) <X64>
SELECT @@VERSION AS 'SQL Server PDW Version';