SQL Server/T-SQL/String Functions/ASCII

Материал из SQL эксперт
Перейти к: навигация, поиск

ASCII("A"): A is 65

   <source lang="sql">

1> 2> 3> SELECT ASCII("A") 4> GO


        65

(1 rows affected)

      </source>
   
  


ASCII:return the ASCII numeric value of the leftmost character of a string

   <source lang="sql">

1> -- ASCII:return the ASCII numeric value of the leftmost character of a string. 2> -- Only the first character in the string is evaluated. 3> 4> DECLARE @ASCII_STRING CHAR(5) 5> SET @ASCII_STRING = "www.sqle.ru" 6> SELECT ASCII(@ASCII_STRING) 7> GO


       119

(1 rows affected) 1>

      </source>