Cloud Training (Online)




How to find the SQL Server Version with a query ?

Few days back , I had to find the SQL Server Version in 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 .

How to find the SQL Server Version with a query ?

@@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 ?


How to find the SQL Server Version with a query ?

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

How to find the SQL Server Version with a query ?
Select SERVERPROPERTY('edition')

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

How to find the SQL Server Version with a query ?

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