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
T-SQL script output
As you can see from the output we got, we are using SQL Server 2019.
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):
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:
- SQL Server Fundamentals – SQL Database for Beginners
- Introduction to Azure SQL Database for Beginners
- Introduction to Azure Database for MySQL
- Working with Python on Windows and SQL Server Databases
- Boost SQL Server Database Performance with In-Memory OLTP
- Essential SQL Server Administration Tips
- Essential SQL Server Development Tips for SQL Developers
- Introduction to Computer Programming for Beginners
- .NET Programming for Beginners – Windows Forms with C#
- Introduction to SQL Server Machine Learning Services
- SQL Server 2019: What’s New – New and Enhanced Features
- Entity Framework: Getting Started – Complete Beginners Guide
- How to Import and Export Data in SQL Server Databases
- Learn How to Install and Start Using SQL Server in 30 Mins
- A Guide on How to Start and Monetize a Successful Blog
- How to Get Started with SQL Server
- Differences Between Batch and Streaming Data
- Difference Between SQL and SQL Server
- What is SQL Server Management Studio?
- What can you do using SQL Server?
- Benefits of Primary Keys in Database Tables
- How to Rebuild All SQL Server Indexes Online
Rate this article:
Reference: TechHowTos.com (https://www.techhowtos.com)