Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Client side or Server Side

Author  Topic 

sp_wiz
Yak Posting Veteran

55 Posts

Posted - 2001-10-23 : 21:34:35
First thanks to Merkin for his article on Keyword searching and tallying..

I have a few questions heres my sp

Declare @Keywords varchar(2000)
Select @Keywords = 'Plants Vegetables'

Select TRANS_NO , PICDESC, count(TRANS_NO) hits
FROM SEQUENCE
INNER JOIN PICDESC ON PICDESC.Picdesc like '%' +
Substring(' ' + @keywords + ' ',seq,
CharIndex(' ' , ' ' + @keywords + ' ' , seq) - seq)
+ '%'


WHERE
seq <= len(' ' + @keywords + ' ') and
Substring(' ' + @keywords + ' ', seq - 1, 1) = ' ' and
CharIndex(' ' , ' ' + @keywords + ' ' , seq) - seq > 0

Group by TRANS_NO, PICDESC

ORDER BY Hits DESC

1. How do i search multiple fields
2. How do i limit the results to AND logic not OR

Alternatively would i be better creating the query string client side and just using a dynamic WHERE clause

Robp


   

- Advertisement -