Hi,
i want to know if i give some value like this:
select * from split('11,12|13,15|16,18')
i should get the output as
Id Value1 Value2
1 11 12
2 13 15
3 16 18
please help me ,how to do this in sql server 2005
Thanks in advance
Splitting commas in a string
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Roei BarRank #1,271 · 1.4K reputationPosted Aug 24, 2009, 12:11 PM EDT
like this
TableName t
CROSS APPLY dbo.udf_PivotParameters(t.fieldnamewithcommas, ',')
just insert the values to a temptable the pivot it with the code attached above
remember to mark this as "Accepted Answer"
priya priya15 reputationPosted Aug 24, 2009, 9:19 PM EDT
'11,12|13,14|15,16'
I want to write a function in sql to remove that ',' and '|' and i need my output as follows:
id value1 value2
1 11 12
2 13 14
3 15 16
thanks in advance