Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Parsing @@Version to get SQL Server edition

Sep 22 2011 1:47AM by Madhivanan   

One of my friends asked me if it is possible to get SQL Server version number and edition name by parsing the result returned from @@VERSION. The system function @@VERSION gives information about the version and operatiing system information of the Server.

The following code parses the result of @@VERSION and displays the version number and SQL Server edition

select 
	substring(version_number,1,charindex(' ',version_number)) as version_number,
	version_name from
	(
	select 
		substring(version,charindex('-',version)+2, charindex('(',version)-patindex('%.[0-9]',version)) as version_number ,
		substring(version,charindex('corporation',version)+11, charindex('edition',version)-charindex('corporation',version)-11) as version_name from
		(
			select @@version as version
		) as t
) as t

Tags: t-sql, sql_server, sqlserver, tsql, #SQLServer, @@version,


Madhivanan
3 · 40% · 12899
2 Readers Liked this
Madhivanan Liked this on 9/22/2011 2:22:00 AM
Profile · Blog · Facebook · Twitter
Guru Samy Liked this on 6/2/2012 4:46:00 AM
Profile · Blog
2
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

2  Comments  

  • Very interesting one! Just saved this code to my code snippets for future purpose. Thanks for the code.

    commented on Sep 26 2011 4:48AM
    Hima
    31 · 6% · 1776
  • If you want the version number and edition from SQL Server, just use SERVERPROPERTY. No string parsing necessary.

    SELECT
      CAST(SERVERPROPERTY('Edition')  as nvarchar(128)), 
      CAST(SERVERPROPERTY('ProductVersion') as nvarchar(128)), 
      CAST(SERVERPROPERTY('ProductLevel') as nvarchar(128))
    
    commented on Oct 10 2011 6:01AM
    Marc Jellinek
    95 · 2% · 586

Your Comment


Sign Up or Login to post a comment.

"Parsing @@Version to get SQL Server edition" rated 5 out of 5 by 2 readers
Parsing @@Version to get SQL Server edition , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]