declare @string varchar(60)
set @string='reverse string'
;with Reverse_string
as
(
select @string string,cast('' as varchar(50)) Rstring,LEN(@string)LN
union all
select SUBSTRING(string,0,ln)string,cast(Rstring+substring(string,LN,1)as varchar(50)) Rstring,ln-1 ln from Reverse_string
where LN>0
)
select Rstring...