June 21, 2018 at 6:34 pm
Hi I am new to sql server
I want to seperate one column which has multiple data seperated by column, do some operations and put the value back as it was before.
Any idea ?
June 22, 2018 at 4:41 am
bharat.radhakrishnen - Thursday, June 21, 2018 6:34 PMHi I am new to sql serverI want to seperate one column which has multiple data seperated by column, do some operations and put the value back as it was before.
Any idea ?
If your question has a typo and you mean "one column which has multiple data seperated by colon" I guess you need to take a look at this link to split the data based on a fixed separator.
June 22, 2018 at 4:51 am
HanShi - Friday, June 22, 2018 4:41 AMbharat.radhakrishnen - Thursday, June 21, 2018 6:34 PMHi I am new to sql serverI want to seperate one column which has multiple data seperated by column, do some operations and put the value back as it was before.
Any idea ?
If your question has a typo and you mean "one column which has multiple data seperated by colon" I guess you need to take a look at this link to split the data based on a fixed separator.
If they do need a string splitter, they might be better using STRING_SPLIT. They are using SQL Server 2017 after all. I'm not saying that Jeff's function isn't good (it's a great piece of kit), however, unless you do need to ordinal position, then they might find better performance from STRING_SPLIT, and it also supports more than 8000/4000 characters.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
June 22, 2018 at 7:08 am
Thom A - Friday, June 22, 2018 4:51 AMHanShi - Friday, June 22, 2018 4:41 AMbharat.radhakrishnen - Thursday, June 21, 2018 6:34 PMHi I am new to sql serverI want to seperate one column which has multiple data seperated by column, do some operations and put the value back as it was before.
Any idea ?
If your question has a typo and you mean "one column which has multiple data seperated by colon" I guess you need to take a look at this link to split the data based on a fixed separator.
If they do need a string splitter, they might be better using STRING_SPLIT. They are using SQL Server 2017 after all. I'm not saying that Jeff's function isn't good (it's a great piece of kit), however, unless you do need to ordinal position, then they might find better performance from STRING_SPLIT, and it also supports more than 8000/4000 characters.
Absolutely agreed. Unless you need the ordinal position (I can't believe MS left that out) or you need a NULL to return if you pass it a NULL, STRING_SPLIT is the way to go.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 22, 2018 at 7:16 am
Jeff Moden - Friday, June 22, 2018 7:08 AMAbsolutely agreed. Unless you need the ordinal position (I can't believe MS left that out) or you need a NULL to return if you pass it a NULL, STRING_SPLIT is the way to go.
You could use OUTER APPLY instead of CROSS APPLY if you know you might/could be using NULL for the input parameter for STRING_SPLIT. That would still work.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
June 22, 2018 at 12:45 pm
Thom A - Friday, June 22, 2018 4:51 AMHanShi - Friday, June 22, 2018 4:41 AMbharat.radhakrishnen - Thursday, June 21, 2018 6:34 PMHi I am new to sql serverI want to seperate one column which has multiple data seperated by column, do some operations and put the value back as it was before.
Any idea ?
If your question has a typo and you mean "one column which has multiple data seperated by colon" I guess you need to take a look at this link to split the data based on a fixed separator.
If they do need a string splitter, they might be better using STRING_SPLIT. They are using SQL Server 2017 after all. I'm not saying that Jeff's function isn't good (it's a great piece of kit), however, unless you do need to ordinal position, then they might find better performance from STRING_SPLIT, and it also supports more than 8000/4000 characters.
The original post specifically said they would need to operate on the pieces and put it back together, so I have to presume that means they'll have a reasonable likelihood of needing the ordinal position in order to be able to reassemble the pieces.
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply