How to get SQL Server Edition, Version related info?

Hi All,

Today’s Question of the day is: How to get SQL Server Edition, Version related info?

SQL Server build related info can be retrieved in no. Of ways, we’ll talk about three of them:

  • @@Version Function

The return type of select @@version is nvarchar. It has few other Functions also like:

select @@version 
select @@SERVERNAME
select @@SERVICENAME

1_How_to_get_SQL_Server_Edition_Version_related_info

  • SERVERPROPERTY() Function

This returns property info about the Server Instance. The example below uses Serverproperty function in a select query to return info related to SQL Server  Product Level, Version, Edition along with Server Name and its collation.

SELECT
SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('MachineName') AS ServerName,
SERVERPROPERTY('Collation') AS ServerCollation
Go

2_How_to_get_SQL_Server_Edition_Version_related_info

   
  • XP_MSVER extended Stored Procedure

This extended stored Procedure returns version information about Microsoft SQL Server. It also returns information about the build number of the server and information about the server environment. This information can be used within Transact-SQL statements, stored procedures, and so on, to enhance logic for platform-independent code. This procedure also returns info about OS & Hardware of the server like WindowsVersion, ProcessorCount, ProcessorType, PhysicalMemory etc.

exec xp_msver

3_How_to_get_SQL_Server_Edition_Version_related_info

If executed without any Parameter it returns information about all Properties, otherwise the output can be restricted to one parameter info by providing property name as a parameter.

exec xp_msver ProcessorCount

4_How_to_get_SQL_Server_Edition_Version_related_info

 

Regards

Sarabpreet Anand

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on Twitter  |  Follow me on FaceBook

   

4 Comments on “How to get SQL Server Edition, Version related info?”

  1. I know it’s an old post. But, I’ll try… There’s an easy way to find out the version and the edition with the SQL turned off?

Leave a Reply

Your email address will not be published.