>
>DECLARE @lcParameter varchar(max)
>SET @lcParameter = 'IN, OUT, CONTAINS, SOMETHING'
>
>SELECT YourTable.*
>FROM YourTable
>INNER JOIN dbo.Split(@lcParameter) TmpSplit ON YourTable.SomeField LIKE '%'+TmpSplit.TheField+'%'
>
>That could return multiple records if more than one key word is presented in the field but you could use DISTINCT.
>I thing Sergey has Split function defined on his site.
You're missing the point.
AND OR CONTAINS is the Operator. And we're passing list of keywords.
So, if we passed AND operator, it would mean
SELECT YourTable.*
FROM YourTable
INNER JOIN dbo.ufn_alines(@Keywords) TmpSplit ON YourTable.SomeField =TmpSplit.Item
Similar for CONTAIN.
However, for OR operator there is no way.
Here is a link to Sergey's function (I recommend it at .NET forum all the time).
Split
If it's not broken, fix it until it is.
My Blog