In this post explains how to use the ASCII function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the ASCII function returns the NUMBER code that represents the specified character. It is the opposite of the CHAR function.
The syntax for the ASCII function in SQL Server (Transact-SQL) is:
The specified character to retrieve the ASCII NUMBER code for. If more than one character is entered, the ASCII function will return the value for the first character and ignore all of the characters after the first.
The ASCII function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server ASCII function examples and explore how to use the ASCII function in SQL Server (Transact-SQL).
For example: