T-SQL Tutorial T-SQL Advanced Database Management T-SQL References

T-SQL @@VERSION Function



The T-SQL (Transact-SQL) @@VERSION function returns the system and build information for the current installation of SQL Server. Please note that the results are presented as one nvarchar string.

For SQL Server, the following information is returned.

  • SQL Server version
  • Processor architecture
  • SQL Server build date
  • Copyright statement
  • 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)"
  • Product version
  • Build date
  • Copyright statement

Syntax

@@VERSION

Parameters

No parameter is required.

Return Value

Returns system and build information for the current installation of SQL Server.

Example:

The example below shows the usage of @@VERSION function.

SELECT @@VERSION;

The above query will return the current version of the SQL Server database and it will display the result similar to:

Microsoft SQL Server 2019 (RTM-CU15) (KB5008996) - 15.0.4198.2 (X64) 
	Jan 12 2022 22:30:08 
	Copyright (C) 2019 Microsoft Corporation
	Express Edition (64-bit) on Linux (Ubuntu 20.04.3 LTS) <X64>

❮ T-SQL Functions