Confused by SQL Server Version Numbers?


Here is a nice picture of all the version numbers, now I still see a bunch of folks who are confused by the info that comes out of SQL Server in terms of versions, so try running the following script;


set nocount on



select @@version



select ‘Edition: ‘ + convert(char(30), serverproperty(‘Edition’))



select ‘Product Version: ‘ + convert(char(20), serverproperty(‘ProductVersion’))



select ‘Product Level: ‘ + convert(char(20),serverproperty(‘ProductLevel’))



set nocount off



The answer for my RTM instance looks like this;


Microsoft SQL Server 2005 – 9.00.1399.06 (Intel X86)

Oct 14 2005 00:33:37

Copyright (c) 1988-2005 Microsoft Corporation

Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 2)


Edition: Developer Edition


Product Version: 9.00.1399.06


Product Level: RTM

The piece of data that confused most people is the part I have highlighted orange, this is the NT Service Pack Level, not the SQL Service Pack level. Part of the reason that folks jump to the conclusion is that the basic information in the first query is very detailed but the one piece it is really missing is the SP level 🙂 This can be retrieved by using Product Level instead.


Update: Changed the Char(20) to a Char(30) per the comments for Edition

Comments (5)

  1. Great Post! Didn’t know that serverproperty was part of T-SQL.

  2. Ax says:

    Is it safe to assume that for SQL Server 2008 the Product Version will be 10.[something]?

  3. mekal says:

    maybe you should change this

    select ‘Edition: ‘ + convert(char(20), serverproperty(‘Edition’))


    select ‘Edition: ‘ + convert(char(30), serverproperty(‘Edition’))

    to accomodate e.g.

    Edition: Enterprise Edition (64-bit)

  4. Michael says:

    Spread the word Euan, the ServerProperty function and its properties are little known but very handy.  Shame there are no OpSys equivalents for Edition, Version & Level…or are there?

  5. Euan Garden says:

    Ax: I believe so.

    Mekal: Good catch, I’ve changed the code.

    Michael: I don’t know of any OpSys stuff, someone should probably write  a nice handy SQLCLR library for this.