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

ASCII

Example

Retrieve the ASCII value of the initial character in the string “CustomerName”.

SELECT ASCII(CustomerName) AS NumCodeOfFirstChar
FROM Customers;

Definition and Usage

The ASCII() function provides the ASCII value associated with a particular character.

Syntax

ASCII(character)

Parameter Values

Parameter

Description

character

This parameter specifies the character for which the ASCII value is returned. If multiple characters are provided, only the ASCII value for the first character will be returned.

Technical Details

Works in:

 SQL Server (beginning from 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse