I'm using MS SQL 2008 and I'm facing a challenge for a few day's now.
My SP parameter can contain one to three words in a string (nvarchar) and I have to return matching LIKE %phrase%
records for each word in a string.
Example. My parameter is:
"stack overflow"
Records that must be returnd:
miSTACKon
noOVERFLOWon
STACKit
poOWERFLOW
STACK
OWERFLOW
I also considered FTS but CONTAINS function takes only one wildcard at the end of the (each) phrase
phrase*
Is there a solution to this problem other than dynamic SQL?