uhlenheuerdotnet
programming, .NET, linux and others

Determine SQLServer version via query

by Gregor Uhlenheuer on October 15, 2011

The very simple way to find out the version of your SQL Server that is currently in use is:

SELECT @@version

The disadvantage of this command is that the whole version string is returned from this query. In order to get more fine grained information about your SQL Server you will want to use SERVERPROPERTY instead:

-- get the product version like '10.50.1617.0'
SELECT SERVERPROPERTY('productversion')

-- get the SQL Server edition like 'Express Edition'
SELECT SERVERPROPERTY('edition')

You can find further information about the SQL Server versions right here: http://sqlserverbuilds.blogspot.com/

This post is tagged with tsql, sql and sqlserver