How to Check SQL Server Version

Share this article!

In this tech how-to, we will see via different examples, how to check SQL Server version. Since there are many methods for checking the SQL Server version, in this how-to, we will see the most commonly-used methods.

 

Method 1: Check SQL Server version using @@VERSION

One of the most popular ways for checking SQL Server version, is to use the system global variable @@VERSION.

When calling the above system global variable in SQL Server, it returns system-related information about your SQL Server instance, including its version.

Let’s see an example of calling @@VERSION on a test SQL Server instance, using the below T-SQL script:

 

T-SQL script syntax

SELECT @@VERSION

 

T-SQL script output

As you can see from the output we got, we are using SQL Server 2019.

 

How to Check SQL Server Version

 

 

Method 2: Check the SQL Server executable version details

Another way for checking the SQL Server version, is by checking the SQL Server executable file’s version details, that is the file “sqlservr.exe”.

To this end, you will need to navigate to the SQL Server “Binn” directory, which can be usually found in:

C:\Program Files\Microsoft SQL Server\[Version.Instance]\MSSQL\Binn

 

In our example, I’m using a SQL Server 2019 named instance (SQL2K19), therefore the path to the SQL Server executable (“sqlservr.exe”) is:

C:\Program Files\Microsoft SQL Server\MSSQL15.SQL2K19\MSSQL\Binn

 

Right after you find the sqlservr.exe file, you right-click on it, and select “Properties“.

Then, within “Properties”, you navigate to the “Details” tab, where you can find File and Product version information.

This is a screenshot of the file and its version details (along with the steps I followed in order to find it in my environment):

How to Check SQL Server Version

 

As you can see in the above screenshot, from the file version, we are using SQL Server 2019.

Also, product version 15 means SQL Server 2019, so this is another way of finding the SQL Server version.

Featured Online Courses:

 

Read Also:

 

 

Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Loading...

Reference: TechHowTos.com (https://www.techhowtos.com)

© TechHowTos.com