SQL SERVER – Script to Determine Which Version of SQL Server 2000-2005 is Running

To determine which version of SQL Server 2000/2005 is running, connect to SQL Server 2000/2005 by using Query Analyzer, and then run the following code:

SQL SERVER - Script to Determine Which Version of SQL Server 2000-2005 is Running

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

The results are:
The product version (for example, 8.00.534).
The product level (for example, “RTM” or “SP2”).
The edition (for example, “Standard Edition”).

For example, the result looks similar to:
8.00.534 RTM Standard Edition

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL Function, SQL Scripts
Previous Post
SQL SERVER – QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF Explanation
Next Post
Checking the Update History of an Instance

Related Posts

2 Comments. Leave new

  • Todd Senauskas
    May 6, 2010 8:04 pm

    This is fine but it does not provide the friendly 2000, 2005 etc version info. Any ideas on reporting a user friendly version number?

    Reply
  • Why can there be a difference between @@version and serverproperty command? Which is more reliable…
    For e.g @@version is stating SP2 and productlevel is stating RTM

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.