I have letter \"a\", \"b\", \"c\". I would like my results to be \"b\", \"c\", \"d\" in TSQL respectively. Would what I use to achieve this?
Here is a CTE with Jonathan Wood's implementation
;WITH cte AS
(SELECT CHAR(ASCII('a')) [char], 1 [count]
UNION ALL
SELECT CHAR(ASCII('a') + cte.count) [char], cte.count + 1 [count]
FROM cte)
SELECT TOP(26) cte.count[pos], cte.char
FROM cte
you can either use it just like that or insert the results into a table variable or temporary table and use it on that.
Another tip I would also give is, have a table in your database with this cte's data, then it is easier in the future to join to it and use it like that for whatever purpose or reason.