T-SQL

ASCII String function in SQL Server

Have you wondered what the ASCII value of a character is whilst using SQL Server? Or needed to quickly check the ASCII value? Or wondered how the ASCII Function worked?

Well the other day I saw one of the developers using the ASCII function which I was not familiar with so I decided to a bit of exploring.
SELECT ASCII( ‘A ‘)
SELECT ASCII( ‘B ‘)
SELECT ASCII( ‘C ‘)
SELECT ASCII( ‘D ‘)
SELECT ASCII( ‘E ‘)
SELECT ASCII( ‘F ‘)
1
The above query shows how easy it is to return ASCII values.
2
The second query shows how you can get the ASCII values from values within a column.
I hope that you liked the above post and hope that you can tell me about your adventures with the ASCII function.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.