Sdílet prostřednictvím


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

go

select @@version

go

select 'Edition: ' + convert(char(30), serverproperty('Edition'))

go

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

go

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

go

set nocount off

go

 

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

  • Anonymous
    January 24, 2008
    Great Post! Didn't know that serverproperty was part of T-SQL.

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

  • Anonymous
    January 27, 2008
    maybe you should change this select 'Edition: ' + convert(char(20), serverproperty('Edition')) to select 'Edition: ' + convert(char(30), serverproperty('Edition')) to accomodate e.g. Edition: Enterprise Edition (64-bit)

  • Anonymous
    February 04, 2008
    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?

  • Anonymous
    February 17, 2008
    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.