Sql Server @@version Function

SQL Server: @@VERSION Function

In this post explains how to use the @@VERSION function in SQL Server (Transact-SQL) with syntax and examples.

Description

In SQL Server (Transact-SQL), the @@VERSION function returns the version of the SQL Server database, including the system and build information.

Syntax

The syntax for the @@VERSION function in SQL Server (Transact-SQL) is:

@@VERSION

Parameters or Arguments

There are no parameters or arguments for the @@VERSION function.

Note

  • The @@VERSION function returns the system and build information for the SQL Server database.

Applies To

The @@VERSION function can be used in the following versions of SQL Server (Transact-SQL):

  • SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008

Example

Let's look at an example and explore how to use the @@VERSION function in SQL Server (Transact-SQL).

For example:

SELECT @@VERSION;

Since the @@VERSION function returns the current version of the SQL Server database, it might display something like this:

SELECT @@VERSION;
Output: 'Microsoft SQL Server 2014 (SP2-GDR) (KB4019093) - 12.0.5207.0 (X64)'

In this example:

  • Microsoft SQL Server 2014 - SQL Server product name
  • SP2 - Product level version. In this example, SP2 stands for Service Pack 2
  • GDR - Product build type. In this example, GDR stands for General Distribution Release which is released through Windows update
  • KB4019093 - Product update reference which is the KB article for that release
  • 12.0.5207.0 - Product version of the instance of SQL Server, in the form of 'major.minor.build.revision'