SQL Server CHAR Function

Example

Return the character based on the number code 65:

SELECT CHAR(65) AS CodeToCharacter;

Definition and Usage

The CHAR() function returns the character based on the ASCII code.

Syntax

CHAR(code)

Continue reading SQL Server CHAR Function

SQL Server ASCII Function

Example

Return the ASCII value of the first character in “CustomerName”:

SELECT ASCII(CustomerName) AS NumCodeOfFirstChar
FROM Customers;

Definition and Usage

The ASCII() function returns the ASCII value for the specific character.

Syntax

ASCII(character)

Continue reading SQL Server ASCII Function