Skip to content

NCHAR

  • integer_expression: This parameter specifies the length for the NCHAR function; it defines the number of characters to be returned. The value must be between 1 and 4000. Although the input can be a constant, variable, or returned from a scalar function, it must always be an integer. The function will return a Unicode string of fixed length, with the length specified being the length of the returned string.
SELECT NCHAR(65);
A

The NCHAR function in SQL Server converts an integer ASCII code to a character. Here, it converts ASCII code 65, which corresponds to the letter ‘A’, into its corresponding character representation.