String Functions – UNICODE()


I am going to write a series of very short articles or tidbits on Transaction SQL (TSQL) functions. I will exploring the UNICODE() function today.

Transaction SQL (TSQL) supports the UNICODE() function that takes a NCHAR or NVARCHAR datatype as input and returns a INT datatype as output. The output value corresponds to the unicode characters location in a chart. This value can range from 0 to 65535.

The following example returns the unicode value for a space which is a value of 32.

One thing to always worry about when using TSQL functions is how will it react with a UNKNOWN or NULL value?

Next time, I will be exploring the UPPER() function.

Related posts

Leave a Comment