June 25, 2009 at 12:13 pm
I'd look at the split method in .Net to create an array for this. Otherwise you might get stuck with some cheesy TSQL string manipulation.
July 20, 2009 at 12:06 am
ab5sr (6/25/2009)
I'd look at the split method in .Net to create an array for this. Otherwise you might get stuck with some cheesy TSQL string manipulation.
I know this is an older post but Cheesy? Heh... you must not know how to do it in T-SQL. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
July 20, 2009 at 12:10 am
Shuaib (6/25/2009)
HiI have a comma delimited values and I want to split this values into mulitple columns. Can someone share the idea / scripts?
Ex
Input
@v-2 = 'A,B,C'
Output
Col1 Col2 Col3
A B C
Thanks
Shuaib
At the risk of being almost a month late to help keep the cheese from stinking too bad ;-), do you still need some help on this? Despite the current sentiment, there are some methods to do this that will rival even a very well formed CLR or (ugh!) a trip to the .Net cottage.
Also, will you always have a fixed number of items to split (ie, 3) or does it need to produce a variable result?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 20, 2009 at 7:59 am
Jeff Moden (7/20/2009)
ab5sr (6/25/2009)
I'd look at the split method in .Net to create an array for this. Otherwise you might get stuck with some cheesy TSQL string manipulation.I know this is an older post but Cheesy? Heh... you must not know how to do it in T-SQL. 😉
LOL I guess I don't. Have they added SPLIT() to the TSQL syntax? I'll have to look it up, right.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply