Generate ASCII table | SansSQL

Thursday, October 10, 2013

Generate ASCII table


Here is T-SQL Query to generate ASCII table

DECLARE @ASCIITable TABLE 
       (AsciiChar nvarchar(2), CharNum int)
DECLARE @CNT INT
SET @CNT = 1

WHILE @CNT < 125
BEGIN
       INSERT INTO @ASCIITable
       SELECT CHAR(@CNT), @CNT
       SET @CNT = @CNT + 1
END

SELECT * FROM @ASCIITable

No comments:

Post a Comment

Ads