UNICODE (TSQL Function)

Returns the unicode code point of the first unicode character in the string.

Syntax

UNICODE ( string_expression )

Arguments

string_expression
is a string expression of type varchar.

Return Types

Returns int.

Remarks

Returns NULL for empty string.

See also ASCII.

Examples

PRINT UNICODE('A'), UNICODE('ALEX'), UNICODE('é'), UNICODE('élève'), UNICODE('Ф'), UNICODE('Феодосия'), UNICODE('');

The result is:

         65|         65|        233|        233|       1060|       1060|     <NULL>|