For one of the requirements, my client asked me, “What is the SQL server version you are using?” Let me tell you there are four simple approaches to checking this.
Approach-1: Using SQL Server Management Studio Object Explorer
1. Open your SQL Server Management Studio and login using the required credentials.
2. You will find the SQL server version in the name of the Object Explorer, as shown in the screenshot below.
You can find the respective product names below based on your version number.
Check out How To Copy One Table To Another In SQL Server
Approach-2: Using the Properties window
1. Right-click on the object explorer and then select the Properties option.
2. On the Properties window, you will see the Version, as shown in the screenshot below.
Check out: How to get table size in SQL Server
Approach-3: Using @@VERSION
You can also check the version of sql server using the query below.
SELECT @@VERSION AS 'SQL Server Version'
or
SELECT @@VERSION
After executing the above query, I got the expected output, as shown in the screenshot below.
You can also use the query below to retrieve the version number, as shown in the screenshot below.
Select SERVERPROPERTY ( 'ProductVersion' ) as 'SQL Server Version'
Check out How To Truncate Table In SQL Server
Approach-4: Using the SERVERPROPERTY method
You can also get the version information from the error log file.
1. Execute the below query to get the error file log path.
Select SERVERPROPERTY ( 'ErrorLogFileName' ) as 'Error Log Path'
After executing the query, you will get the path of your error log file, as shown in the screenshot below.
Now, navigate to the same path on your PC and see the version in the screenshot below.
Conclusion
Knowing your SQL Server version is Crucial as it helps you troubleshoot issues and plan for the upgrades and updates accordingly. There are multiple ways to do this, as mentioned in this article; now it’s your choice which approach suits you.
You may also like following the articles below.
Grey is a highly experienced and certified database expert with over 15 years of hands-on experience in designing, implementing, and managing complex database systems. Currently employed at WEX, USA, Grey has established a reputation as a go-to resource for all things related to database management, particularly in Microsoft SQL Server and Oracle environments. He is a Certified Microsoft SQL Server Professional (MCSE: Data Management and Analytics) and Oracle Certified Professional (OCP), with Extensive database performance tuning and optimization knowledge and a proven track record in designing and implementing high-availability database solutions.