lcSource = 'abcdefghijklmnopqrstuvwxyz' ? TRANSFORM(TRANSFORM(lcSource), '@R ' + REPLICATE('9,', LEN(TRANSFORM(lcSource)))) lcSource = 1234567890 ? TRANSFORM(TRANSFORM(lcSource), '@R ' + REPLICATE('9,', LEN(TRANSFORM(lcSource))))Can I do this in T-SQL without loops? I am creating a dial string from a list of numbers selected from a table, but I need to introduce a pause (a comma) between each digit, my current select looks like this:
Select @cDialNumbers += Cast(Stations.StnNo as varchar(10)) + ',' from Stations join master.dbo.int$ListToCursor(@cList, ';') L ON L.Value = Stations.PK order by Stations.StnNo;The parameter to this function (@cList) was a semi colon separated list of stations id that is why I need the join but we can ignore it for this problem, that works fine, my problem is that this way I only insert a pause between stations and I need a comma between each digit of the StnNo too