How To Find the ASCII Value of each character in your String – SQL Server


 
Here’s a simple query that lists the ASCII Value of each character in your string in SQL Server

DECLARE @counter int = 1;DECLARE @colString varchar(10) = 'AA%#& ';
WHILE @counter <= DATALENGTH(@colString)
BEGIN
SELECT CHAR
(ASCII(SUBSTRING(@colString, @counter, 1))) as [Character],
ASCII(SUBSTRING(@colString, @counter, 1)) as [ASCIIValue]

SET @counter = @counter + 1
END
GO
 

Comments

Popular posts from this blog

How to Read TOC Headings from word document using C#

List of special Characters in HTML