Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

UNICODE

Example

Return the Unicode value as an integer for the first character of the input expression.

SELECT UNICODE(‘Atlanta’);

Definition and Usage

The UNICODE() function returns the Unicode code point (integer value) for the first character of the input expression.

Syntax

UNICODE(character_expression)

Parameter Values

Parameter

Description

character_expression

Required. A string expression that can be either nchar or varchar.

Technical Details

Works in:

Available in SQL Server from 2008 onward, as well as in Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse.

More Examples

Example

Retrieve the Unicode code point (integer value) for the first character of the input expression.

SELECT UNICODE(CustomerName) AS UnicodeOfFirstChar
FROM Customers;