Split a set of contiguous string into individual characters/letters using Set Based approach

Niladri.Biswas
Posted by Niladri.Biswas under Sql Server category on | Points: 40 | Views : 752
Declare @str Varchar(50) = 'abcde'

Select
Data = Substring(@str,Number,1)
From master.dbo.spt_values
where Number Between 1 And Len(@str)
And Type='P'

Comments or Responses

Login to post response