The T-SQL provides
ASCII function and
First function get one argument(string expression) as
varchar datatype and return int value. This returned value is decimal code for char in
ASCII encoding. This function get only first char from string(argument of function). It is example for ‘a’ letter.
SELECT ASCII('a') as [ASCII(a)] ;
For diacritic chars this function works very well, either.
SELECT ASCII('ą') as [ASCII(ą)] ;
For check this values, You may use
CHAR function. This function get one argument as decimal code in
ASCII of char( the integer from 0 through 255 ). It returns
So let check ‘a’ and ‘ą’ letters.
SELECT CHAR(97) as [CHAR(97)] , CHAR(185) as [CHAR(185)] ;
You may see the same chars, that was be displayed in first and second example.