foxxo (9/27/2010)
Why doesselect i+1, char(i+1), isnumeric(char(i+1)) from l where i < 127
need an i+1 in each column?
If you use
select i+1, char(i), isnumeric(char(i)) from l where i < 127
Then you'd probably get the same results from the summation, but if you check the actual rows produced by the CTE, you'd see weird results. For example, when i = 80, you'd get the number 81 for the row with char(80) and isnumeric(char(80)).