July 2, 2012 at 8:42 am
Does SQL have something (like Pick) that will search a string, and then break the string apart by that char?
For example... using the underscore
asdl;kfj_doske
fjdkls_lkjd
into..
asdl;kfj
doske
fjdkls
lkjd
July 2, 2012 at 8:49 am
There is no function to do this, but you can write one using the PATINDEX/CHARINDEX functions and SUBSTRING.
July 2, 2012 at 8:53 am
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 2, 2012 at 9:09 am
dwilliscp (7/2/2012)
Does SQL have something (like Pick) that will search a string, and then break the string apart by that char?For example... using the underscore
asdl;kfj_doske
fjdkls_lkjd
into..
asdl;kfj
doske
fjdkls
lkjd
Have you searched this site for delimited split routines?
This article is a greate place to start: http://www.sqlservercentral.com/articles/Tally+Table/72993/
July 3, 2012 at 10:01 am
Thanks folks.. I did do a search, but I was looking at SQL commands... for some reason never thought to search the way you suggested, thanks Lynn. ๐
July 3, 2012 at 10:52 am
I would probably build a SQL CLR routine to do it. String manipulation is *almost* (YMMV) always faster when manipulating text this way. If you are only doing a little then probably not the way to go..
CEWII
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply