Thursday, May 22, 2008

Confusing @@VERSION?

I was confused when i first ran the SELECT @@VERSION query and saw the result out of that query. Try to run the following query in SSMS:

PRINT @@VERSION
GO
PRINT 'Edition: ' + CONVERT(CHAR(30), SERVERPROPERTY('Edition'))
GO
PRINT 'Product Version: ' + CONVERT(CHAR(20), SERVERPROPERTY('ProductVersion'))
GO
PRINT 'Product Level: ' + CONVERT(CHAR(20),SERVERPROPERTY('ProductLevel'))
GO

Result:-
---------------------------------------------------------
Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
Feb 9 2007 22:47:07
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
Edition: Enterprise Edition
Product Version: 9.00.3042.00
Product Level: SP2

I have highlighted the confusing part in RED. This is Windows NT Service Pack Level, Not the SQL service Pack Level.

The reason i went to conclusion that the output provided by the query is very detailed one but i guess they missed to include sql server pack infrmation there.[;)]. Anyway we can get that information through SERVERPROPERTY('ProductLevel').

~ Kiran

No comments: