Monday, June 22, 2009

How to find SQL Server Version?

If you need to deploy the SQL Server agents, one of the items prompted for is the SQL Server Version. Most of us know the SQL Server by the year it was released as in SQL Server 2000, 2005 or 2008, but it is not the version number. (Version 2000 of SQL Server would be a rock-solid SQL Server, wouldn't it? :)).

Here is how to identify the version. Connect to the database server in question using Query Analyzer or SQL Server Management Studio and run the following SQL.

SELECT SERVERPROPERTY('productversion')

The above query on SQL 2005 returned 9.00.3042.00 and your result may vary depending on the Service Pack level. Generally speaking, SQL Server 2000 is version 8.x, 2005 is version 9.x and 2008 is version 10.x.

Hope this helps.

2 comments:

Bazza said...

In order to execute that SQL you must first connect to the server in question.

For those that like to steer well clear of executing any T-SQL - if you are using MS SQL Server Management Studio (came in with SQL2005), then the SQL version is given in brackets within the 'Object Explorer' view.
In the format: SERVERNAME\INSTANCE (SQL Server x.0.xxxx - USERNAME)
Where x is the version of SQL (8/9/10/etc), and xxxx is the revision number - see below).

Failing that, right-click on the server (in 'Object Explorer') and select 'properties', and the version is given on the default ('General') tab.

And, once you have the revision number, if you want more detail on exactly which revision of SQL you have:
Microsoft: How to identify your SQL Server version and edition

Venkat said...

Bazza,

Thank you for the additional information!