September 15, 2010 at 8:17 pm
Comments posted to this topic are about the item Way to Check Multiple LIKE without dynamic SQL
September 16, 2010 at 2:13 am
Thanks for this, I didn't know about fn_split or the CROSS APPLY.
September 16, 2010 at 2:40 am
if you use function !!! write new fn_split_find and don't use cross apply .it's will be work more faste :-D)
select * from @mytbl where fn_split_find(likestring,@param) >0
September 16, 2010 at 4:17 am
you can find fnSplit on the net. just google it and you will find the code for it.
This is just an approach of performing a task without dynamic SQL. Otherwise, I think using dynamic sql in such situations will be more helpful.:-)
September 16, 2010 at 4:35 am
Atif-ullah Sheikh (9/16/2010)
@adudleyyou can find fnSplit on the net. just google it and you will find the code for it.
This is just an approach of performing a task without dynamic SQL. Otherwise, I think using dynamic sql in such situations will be more helpful.:-)
Absolutly 🙂
fn_split 🙂
http://bi-tch.blogspot.com/2007/10/sql-clr-net-function-split.html
September 16, 2010 at 12:15 pm
But, if it contains both strings, you'll get it in the output twice. You may need a DISTINCT.
Also, you're not really using the CROSS APPLY functionality. This could just as easily be a JOIN (using ON instead of WHERE), since your function isn't using anything from @vTable, so it doesn't need to be re-executed for each row.
September 16, 2010 at 12:46 pm
Thanks it's good to see how others put together T-SQL and its built-in functions to come up with clever solutions. Keeps the mind nimble.
May 18, 2016 at 7:16 am
Thanks for the script.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply