SQL Server NCHAR() Function

The NCHAR() function in SQL Server is used to retrieve a Unicode character given its corresponding numeric code point.



NCHAR(): Definition and Usage

Unicode is a standard for representing characters from virtually all writing systems. Each character has a unique numeric code. NCHAR() takes this code as input and returns the character itself.

Syntax

Syntax

NCHAR(number_code)
      

Parameter Values

Parameter Description
number_code The Unicode code point (a number) of the character you want to retrieve. This is required.

Example

Getting a Unicode Character

This example shows how to get the character corresponding to Unicode code point 65 (which is 'A').

Syntax

SELECT NCHAR(65) AS NumberCodeToUnicode;
      
Output

A
      

Technical Details

NCHAR() is available in:

  • SQL Server (starting with version 2008)
  • Azure SQL Database
  • Azure SQL Data Warehouse
  • Parallel Data Warehouse