Is there a way to create search based on number of words?
For example if I search for car and wheel it would create T-SQL search like
select * from table
where
(word is like @word1)
and (word is like @word2)
where @word1 is car and @word2 is wheel.
It could be any number of words, therefore this should be dynamic.
Thanks.
Try this, @wordtable can dynamically contain all the words you want. and it will only find the rows from @table where all words exists:
“Contains” would proberly still be better. But this is a decent way of solving the problem.