[thelist] message board / guestbook SPAM DILEMMA

Mark Rees mrees at itsagoodprice.com
Mon Oct 24 04:15:16 CDT 2005


Hello

Try reading up on Full Text Search in SQL Server Books Online. If you have
sufficient administrative control over your SQL server, this is an option
you should probably investigate if you are running a lot of queries like the
one below.

Cheers

Mark
----- Original Message -----
From: "Andrew Martin" <andrewdmartin at gmail.com>
To: <thelist at lists.evolt.org>
Sent: Sunday, October 23, 2005 9:51 PM
Subject: Re: [thelist] message board / guestbook SPAM DILEMMA


> I'm converting my sql queries to stored procedures on my Sql Server.
> Is there a way to do a loop through variables to add them to the
> stored procedure function?
>
> Currently, I split the form data into words and send them on to the
> sql query: "Rowling Potter Harry" is split into the three words and
> then I append the terms to a sql query:
> "AND author like 'rowling' or title like 'rowling'"
> "AND author like 'harry' or title like 'harry''"
> etc.
>
> Is there an easy way to do this with stored procedures?  Something like:
>
> pass into sql server: sp_searchBooks "rowling", "potter", "harry"
>
> procedure: CREATE PROCEDURE sp_searchBooks
> @value[x] varChar(100)
> AS
> SELECT author, bookname
> FROM catalog
> WHERE
>  Do until valueNumber = x
>     AND (author LIKE '%' + @searchName + '%' OR bookname LIKE '%' +
> @searchName + '%')
> Loop





More information about the thelist mailing list