SQL Flow Field Guide

ASCII

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

string transform

What changes

Input
string arguments
Output or change
string or integer
Return type
int

Syntax at a glance

ASCII ( character_expression )

Work example

Read the code of the first character in a non-Unicode expression.

Test Unicode, trailing spaces, collation, empty input, and maximum output length.

Check your work Use UNICODE for Unicode text and check the column encoding.

Open Microsoft Learn for full syntax, permissions, and details for your version.