Monday, October 17, 2011

Detecting the version of SQL Server

I always find myself using google to remember how to check for the exact version of SQL Server that I'm working with.  @@Version always makes it more difficult to parse with everything thrown into a single column, so prefer a different method. 

Below is a script that I like to Use.  This is really just a combination of Method 3 and Method 4 from the following link: 
http://support.microsoft.com/kb/321185

SELECT @@Version as FullDetail, SERVERPROPERTY('productversion') as VersionNumber, SERVERPROPERTY ('productlevel') as ServicePack, SERVERPROPERTY ('edition') as Edition


The above method is the way I teach people to do it, because I've seen a few Junior DBA's confuse the OS information as SQL Server info from some of the details in @@Version.




No comments:

Post a Comment