ascii

Returns the ASCII code for the first character in an expression.

Syntax

ascii(char_expr | uchar_expr)

Parameters

Examples

Usage

When a string function accepts two character expressions but only one expression is unichar, the other expression is “promoted” and internally converted to unichar. This follows existing rules for mixed-mode expressions. However, this conversion may cause truncation, since unichar data sometimes takes twice the space.

If char_expr or uchar_expr is NULL, returns NULL.

See also Transact-SQL Users Guide.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute ascii.

Related reference
char
to_unichar