Friday, March 1, 2013

SQL Server UNICODE Function

In this post , I will explain the UNICODE function of SQL Server of string function category.
In my previous posts, I explained LEFT Function, CHARINDEX Function, CHAR Function, ASCII Function, Simple script to backup all SQL Server databases, Table-Valued Parameters and some other articles related to SQL Server.

Here, I am going to explain UNICODE function of SQL Server.

UNICODE() Function

This function returns the Unicode integer value of the first character of input expression.
 
Syntax- UNICODE(character_expression)
Arguments-  
  • character_expression : An nchar or nvarchar input expression.
Return Type- integer

Example-
 
DECLARE @nstring nchar(12)
SET @nstring = N'Åkergatan 24'
SELECT UNICODE(@nstring),NChar(UNICODE(@nstring))
-- OutPut 197---Å

No comments:

Post a Comment

^ Scroll to Top