How to Interpret SELECT @@VERSION in SQL Server

One common point of confusion that I often see when people run the SELECT @@VERSION query is how to properly understand the results that are returned. I have seen many people mix up the SQL Server portion of the results with the Operating System portion of the results.

Everything in the results before the word “on” is referring to the version, build, and edition of SQL Server. Everything after the word “on” is referring to the operating system that SQL Server is running on, not SQL Server itself.

In both examples below, we have the x64 version of SQL Server 2008 R2 RTM, Build 10.50.1753.0 (which is CU5) Enterprise Edition.

In Example 1, we are running on x64 Windows Server 2008 R2 Service Pack 1, Build 7601, while in Example 2, we are running on x64 Windows Server 2008 R2 RTM, Build 7600.

Since Windows 7 and Windows Server 2008 R2 share the same code base, you cannot distinguish between the two using this query. Of course, you should not be using Windows 7 for Production SQL Server usage anyway.

Example 1:

Microsoft SQL Server 2008 R2 (RTM) – 10.50.1753.0 (X64)   Dec 10 2010 22:13:00   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

 

Example 2:

Microsoft SQL Server 2008 R2 (RTM) – 10.50.1753.0 (X64)   Dec 10 2010 22:13:00   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

SELECT @@VERSION is a very useful query that gives you a lot of valuable information if you know how to read the results properly.

This entry was posted in SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, Windows Server 2008 R2 and tagged . Bookmark the permalink.

3 Responses to How to Interpret SELECT @@VERSION in SQL Server

  1. Joe Webb says:

    Nice post, Glenn. There’s a lot of confusion about how to interpret the output of @@version.

  2. Pankush says:

    Hi Glenn,

    Great post.

    Is there any way to distinguish between an MSDN licence and a professional licence?

  3. Pingback: Weekly Link Post 183 « Rhonda Tipton's WebLog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s