bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server ASCII() Function

Concept visual

SQL Server ASCII() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

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 )

Parameter Values

Parameter

Description character

Required. The character to return the ASCII value for. If more than one character is entered, it will only return the value for the first character

Technical Details

Works in:

SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse ❮ SQL Server Functions

Next

Previous

SQL Server Functions

Next

SQL Server CHAR() Function