|
Posted by laurenquantrell on 10/13/02 11:59
I have a query below that performs horribly:
@KeywordOne char(6),
@KeywordTwo char(6),
@KeywordThree char(6),
@KeywordFour char(6),
@KeywordFive char(6)
SELECT
c.Something
FROM
dbo.tblStuff c
WHERE
c.SomeColumnName = 0
AND (c.Keyword LIKE '%' + @KeywordOne + '%' OR @KeywordOne is Null)
AND (c.Keyword LIKE '%' + @KeywordTwo + '%' OR @KeywordTwo is Null)
AND (c.Keyword LIKE '%' + @KeywordThree + '%' OR @KeywordThree is
Null)
AND (c.Keyword LIKE '%' + @KeywordFour + '%' OR @KeywordFour = is
Null)
AND (c.Keyword LIKE '%' + @KeywordFive + '%' OR @KeywordFive = is
Null)
The contents of column c.Keyword looks like this:
Row1: 123456,321654,987987,345987
Row2:
Row3: 123456,987987
etc.
What can I do to get this to perform reasonably? I cannot use full-text
search.
Any help is appreciated.
lq
Navigation:
[Reply to this message]
|