Goglides Dev 🌱

Varun Pal
Varun Pal

Posted on

How to Determine SQL Server Version: A One-Stop Identify SQL Version

Image description
In this blog, we’re going to learn how to determine SQL Server version using the top 2 methods. We are pretty much sure that SQL users can easily get the perfect solution after reading this entire post. However, they must be attentive throughout the blog to how to know SQL server version without facing any difficulties.

User Problem

As an MS SQL Server Database Administrator, one recurring challenge I encounter is how to determine SQL Server version of the database engine installed on SQL Server. In this comprehensive guide, we will delve into the complexities of locating and interpreting the version of SQL Server running the workload. Additionally, we will determine the presence of service packs, hotfixes, security updates, and cumulative updates within the environment.

Reasons for knowing SQL Server Database Version

  • Measure Security Updates: Microsoft SQL Server DB releases major and minor security updates regularly and patches for SQL Server to tackle vulnerabilities, bugs, glitches, etc. Ensure that the user is aware of the SQL Server versions the user is using to keep it updated with the latest security updates and patches.

  • System Compatibilities: Due to system compatibility, several tools and applications cannot be used with specific versions of MS SQL Server. If the user is utilizing an earlier application or tool, it may be only compatible with an earlier version of the MS SQL Server database.

  • Trait Availability: Every version of SQL Server has its own set of features and properties available. When each time a new update comes in a particular version of SQL Server, a new feature could be added or removed from it. Hence, it is important to ensure that users know the versions of the SQL Server so that they can access the new features it requires.

In the upcoming section, we will discuss manual solutions for how to determine SQL Server version in simple steps.

How to Determine SQL Server Version Using Manual Solutions

There are several ways to know the SQL Server version that is installed on any operating system such as Windows, Linux, and macOS.

Solution 1 Determine SQL Server Version With SSMS.

SQL Server Management Studio (SSMS) can be used to know the SQL Server database.

  1. First, open SQL Server Management Studio (SSMS).
  2. Now, go to the Object Explorer window, right-click on the Server Name, and choose Properties.
  3. In the Server Properties option, go to the Connection tab.
  4. The SQL Server version will be shown under Server Version.

Solution 2 Determine SQL Server Version With T-SQL Command

Users can use some T-SQL commands to know the version and edition of the installed SQL Server.

  1. Start with the opening of SQL Server Management Studio (SSMS).
  2. Now, connect to your SQL Server Instance.
  3. Execute the following SQL command.

SELECT SERVERPROPERTY('SQLProductVersion') AS 'Version’.

The command will revert to the current MS SQL Server version number.

Solution 3 Determine SQL Server Version With PowerShell Command or Bash Command

By executing the below command, the user can view the version and edition of MS SQL Server using the PowerShell command.

Invoke-Sqlcmd -ServerInstance "Database-PC" -Query "Select @@version"

For Linux users, they can use the SQLCMD command line tool to view the SQL Server version. The command is below.

root@UbuntuSQL2019:/# sqlcmd -S UbuntuSQL2019 -U SA
Password:
1> select @@version as [SQLServer Version]
2> Go

*Solution 4 Determine SQL Server Version With SQL Server Error log File *

By utilizing the error log file, the user can find the version and edition of SQL Server.

  1. Users can search the errors log in the instance root directory.
  2. Now, open the ERRORLOG file in the instance root directory using Notepad or any other text editor.
  3. Users can view the version and edition number of the SQL Server, and create a number in the ERRORLOG file.
  4. For the Linux operating system, the user can open SQL Server error using Vim or any other editor. The command to open the error log file is below.

root@UbuntuSQL2019:/# vim /var/opt/mssql/log/errorlog

Solution 5 Determine SQL Server Version by EXE File Details

If the SQL Server isn't operational, and you need to identify its version, you can also check the version of the SQL Server files as an alternative method.

  1. First, open SQL Server Management Studio (SSMS), then go to Windows Explorer.
  2. Now, in Windows Explorer find the folder where SQL Server is installed such as "C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2022\MSSQL\Binn", for SQL Server 2022.
  3. Find the file sqlserver.exe and right-click and choose properties, and a window will open.
  4. Now, the user can view the file version of SQL Server.

In the coming section, we will discuss the smart solution for how to know the SQL server version effectively and reliably.

How to Determine SQL Server Version Using Smart Solution

If the above-mentioned manual solution does not work for any reason, then the user can switch to the expert-recommended software called SysTools SQL Database Recovery Tool. This software efficiently identifies the SQL Server version and edition. This tool repairs and recovers all the important SQL objects like functions, triggers, rules, views, tables, stored procedures, etc. MS SQL Server versions (2022, 2019, 2017, 2016, 2014, 2012, 2008 R2, 2005, and 2000) are all supported by this tool. It easily recovers data from malware and SQL injection-affected MDF files. Users can export data to new or current SQL Server Database without any difficulty.

Follow these Steps to find the version of SQL Server.

  1. Download, install, and launch the software application on your computer.
  2. Now, click to open and add the damaged MDF file.
  3. Select, Quick scan and Advanced scan option for corruption level.
  4. Now, in this step, the user can know the SQL Server version and edition.
  5. Select the export option, such as CSV File, SQL Server Database, and SQL Compatible Script.
  6. Export the data with schema or schema & data.
  7. Lastly, start the export process and save the file.

Final Words

In this blog, we discuss the reasons for knowing SQL Server versions and different manual solutions for how to determine SQL Server version. In addition, we discuss a smart solution to quickly identify the SQL Server version in a hassle-free way. The user can use any method, but it is recommended to use a smart solution.

Top comments (0)