declare @mydata nvarchar(4000)
set @mydata = '36|0, 77|5, 132|61'
I have this data that I need to get into a table. So for Row1 columnA would be 36 and columnB would be 0. For Row2 columnA would be 77 and columnB would be 5 etc.
What is the best way to do this?
Thanks
You need a split table-valued-function. There’s plenty of examples on the web, e.g. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648
I just picked the first split function I found. I don’t thnk it’s the best one but it works for this eample.
Ths outputs: