ASCII returns the ASCII numeric value of the leftmost character of a string. : ASCII « String Functions « SQL Server / T-SQL Tutorial






Only the first character in the string is evaluated.

40> DECLARE @ASCII_STRING CHAR(5)
41> SET @ASCII_STRING = "www.java2s.com java2s"
42> SELECT ASCII(@ASCII_STRING)
43> GO

-----------
        119

(1 rows affected)








12.1.ASCII
12.1.1.ASCII returns the ASCII numeric value of the leftmost character of a string.
12.1.2.Converting a Character Value to ASCII and Back to Character
12.1.3.Converting an ASCII Value to Character