Get Unicode Vlue of Character in SQL Server 2012

UNICODE function returns the integer value as defined by the Unicode standard. It works for only first character of the input expression.

Syntax

UNICODE ( 'ncharacter_expression' )

Example 1:

  1. DECLARE @nstring nchar(7)  
  2. SET @nstring = N'Jignesh'  
  3. SELECT UNICODE(@nstring)  

Result:

74

Example 2: 
  1. DECLARE @nstring nchar(1)  
  2. SET @nstring = N'§'  
  3. SELECT UNICODE(@nstring)   
Result:

167