September 16, 2014 at 8:44 am
Hi Jeff
Thanks for the input.
The code I'm (trying to) write needs to check the sequence of the codes in post #1.
I don't think the code I posted from my WHERE clause is quite right (although I think the theory is sound).
I'd be grateful for any advice you could give.
September 16, 2014 at 8:59 am
Have you tried going for a fancier pattern? If all you want is to find the pattern, no sense in parsing the string
I kind of think this is what you want:
select code from #test where patindex('%Q2[234]%Q0[78]%',code)>0
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
September 16, 2014 at 9:26 am
Thanks Matt
That looks to have done the trick.
I'll have to double-check but it looks good at first pass.
September 16, 2014 at 10:55 am
richardmgreen1 (9/16/2014)
Thanks MattThat looks to have done the trick.
I'll have to double-check but it looks good at first pass.
I'll second Matt's solution over splitting the data. Even if you use a CLR to do the split, it'll still be really expensive compared to Matt's solution.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply