Check version information in SQL Server

This article will show you in detail how to use the @@ VERSION query to check the information that SQL Server version is using.

Describe

Query @@ VERSION is used to determine the version of SQL Server you are using with the same operating system information.

Syntax

To use the VERSION function in SQL Server, we use the following syntax:

 @@VERSION 

There are no parameters and arguments in the statement.

Note :

  1. VERSION can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, and SQL Server 2008.

For example

To check the information the SQL Server version is using, we run the query:

 SELECT @@VERSION; 

Results returned:

 Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64) 
  1. Microsoft SQL Server 2017: SQL Server product name
  2. KB4052987: article describing the update
  3. 14.0.3015.40: version number
  4. X64: 64-bit version of SQL Server.

Previous article: TRY_CONVERT function in SQL Server

Next lesson: CASE function in SQL Server

4 ★ | 2 Vote

May be interested

  • CASE statement in SQL ServerPhoto of CASE statement in SQL Server
    this article will show you in detail how to use the case statement handling function in sql server with specific syntax and examples to better visualize and capture functions.
  • COALESCE statement in SQL ServerPhoto of COALESCE statement in SQL Server
    the coalesce statement returns the expression with the first non-null value among the passed expressions.
  • CURRENT_USER statement in SQL ServerPhoto of CURRENT_USER statement in SQL Server
    the current_user statement returns the name of the current user in the sql server database.
  • ISDATE function in SQL ServerPhoto of ISDATE function in SQL Server
    the isdate function in sql server checks to see if the expression passed is a valid time value, if isdate returns 1, otherwise it returns 0.
  • ISNULL function in SQL ServerPhoto of ISNULL function in SQL Server
    in sql server, the isnull function allows you to return an alternate value when an input expression is null.
  • ISNUMERIC function in SQL ServerPhoto of ISNUMERIC function in SQL Server
    the isnumeric function in sql server checks whether the value of the passed expression is a valid numeric value, if there is isnumeric returns 1, otherwise it returns 0.