Let us explore the multiples ways to check the SQL Server version. At the end of this article, you will know how to quickly and easily determine the SQL Server version and edition that is installed on your system.
Multiple Ways to Check the SQL Server Version
1. Using T-SQL
The easiest way to check the SQL Server version is using the Transact-SQL (T-SQL) which is a query language that is used to interact with the SQL Server. To check the SQL Server version, simply open the SQL Server Management Studio (SSMS) and execute the following query:
This query returns a result set that includes the SQL Server version, edition, and other information about the server.
Output:
The first line of the result set shows the SQL Server version, edition, and the latest cumulative update (CU) applied. In this example, we can see in the output that the SQL Server version is 2022 and the edition is “Developer Edition”.
2. Using the SQL Server Properties
This method is considered to be one of the simplest ways to determine the version of the SQL Server that is currently installed on your system. Follow these steps to access the “SQL Server Properties”:
Open the “SQL Server Management Studio”. Then, connect to the SQL Server instance that you want to check.
Right-click on the parent menu [DESKTOP-ONHTAB] and go to “Properties”.
Then, click on the “Server Properties window” and go to “General tab”.
Here, we can see the product, version, and other information of the SQL server properties.
3. Using the SQL Query SELECT
This method involves using the SQL Server function called SERVERPROPERTY to retrieve an information about the installed SQL Server instance. The SERVERPROPERTY function provides information about the product version, product level, and edition of the SQL Server.
Click on the “New Query” to open a new query window. Then, type the following T-SQL statement in the query window:
SERVERPROPERTY('productversion') AS ProductVersion,
SERVERPROPERTY('productlevel') AS ProductLevel,
SERVERPROPERTY('edition') AS Edition
GO
Now, click the “Execute” button to execute the query.
Output:
16.0.1000.6 RTM DESKTOP-0NHNTAB Developer Edition(64-bit)
The result set displays the product version, product level, server name, and edition of the SQL Server that is installed on your system. This method is useful to quickly retrieve the full information about the currently used SQL Server.
4. Using the Registry Editor
Finally, you can also check the SQL Server version using the Registry Editor. The Registry Editor is a software application provided by Microsoft Windows that permits the users to access, view, and edit the changes to the Windows Registry. To check the SQL Server version using the Registry Editor, we have to follow these steps:
Press the “Windows key + R” to open the “Run” dialog box. Then, type “regedit” and press “Enter” to open the Registry Editor.
Navigate to the following registry key in the Registry Editor:
Replace “MSSQL16.MSSQLSERVER” with the name of your SQL Server instance.
In the right pane, you can see product version, edition type, server name, SQL installation path, etc.
Conclusion
We learned the multiple ways to check the version of the SQL Server that is used in our system. These methods provide a detailed information about the SQL Server version including the build number, product level, and edition. By knowing the version of the SQL Server that is installed on your system, you can ensure that your applications are compatible and can take advantage of the latest features and improvements.