How to find the SQL Server Version with a query ?

Few days back , i had to find the SQL Server Version on one of the Machine and here’s a query that i used or executed in the SQL Server Management Studio to find out the version of the SQL Server .

Select @@version

The @@version will return “Microsoft SQL Server 2008 R2 (RTM) – 10.50.1617.0 (X64)   Apr 22 2011 19:23:43   Copyright (c) Microsoft Corporation  Express Edition with Advanced Services (64-bit) on Windows NT 6.1 <X64> (Build 7600: )” in the Results window .



@@version returns the complete string from which you can identify all the properties but how do one find out the individual properties of the SQL Server like the product versions , edition ( enterprise or Express ) etc ?

SERVERPROPERTY in SQL Server does the work for you . It simply returns the value of the required propery lik productversion , productlevel , edition etc .

Select SERVERPROPERTY('productversion')

The above code will return the SQL Server product version

Select SERVERPROPERTY('edition')

The above code will return the Edition ( Express , Enterprise etc )

Wondering what is 10.50.1617 ?? It is the SQL Server with security update for SQL Server 2008 R2 GDR

Want to know about the different versions of SQL Server , SQLSERVERBUILDS.BLOGSPOT.COM provides a useful list of the version numbers for reference


If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

No Responses

Leave a Reply


Interesting BlogPosts to read

Column Alias and Square brackets in SQL Query.
When we want to specify a alias for a column in SQL Query , we tend to use the double quotes or sing...
How to get the MAX row with group by in LINQ query using C# ?
Below is a sample code snippet demonstrating how to retreive the max row with the group by in LINQ Q...
Webinar - The Shortcomings of SQL for SharePoint Sync
Redmond Magazine is hosting a webinar on the topic "The Shortcomings of SQL for SharePoint Sync" on ...