Detecting current version and edition of SQL Server

Here’s a handy script to tell you exactly what edition and version of Microsoft SQL Server you’re looking at.

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

My local installation of SQL Server gave me the following output

----------------------------------------------------------------
Microsoft SQL Server 2012 - 11.0.5058.0 (X64) 
	May 14 2014 18:34:29 
	Copyright (c) Microsoft Corporation
	Developer Edition (64-bit) on Windows NT 6.1  (Build 7601: Service Pack 1)

---------------------------------------
Edition: Developer Edition (64-bit)    

-------------------------------------
Product Version: 11.0.5058.0         

-----------------------------------
Product Level: SP2                 

I found this script on Euan Garden’s blog under the post ‘Confused by SQL Server Version Numbers?

Subscribe

0 comments