I have something like
set @file = 'aaaa,bbbb,cccc,dddd,eeee,ffff'
SELECT SUBSTRING(@file,CHARINDEX(',',@file)+1, CHARINDEX(',',@file,CHARINDEX(',',@file)+1) -CHARINDEX(',',@file)-1) as My_string
This will print out
My_string
----------------
1| bbbb
How could I make it print?
My_string
------------
1| bbbb
2| cccc
3| dddd
4| eeee