Quang,
Lacking any specifics as to what you're trying to do, I can offer the
following generalities:
Your Where clause, which currently is:
Where SomeColumn LIKE '%' + sCriteria + '%'
would have to be modified to accomodate the search criteria. This would
involve parsing sCriteria, looking for occurences of AND and OR and building
a new Where clause as a string value, which forces your entire query to
become a string that has to be Executed. Doing this obviates much if not
all of the performance advantage of stored procedures.
Accordingly, if your requirements are to include AND and OR search
statements, you'd be better served to write the parser in a procedural
language like VB and pass the query to the data base directly. SQL is not
particularly well suited to string manipulation whereas VB is quite good at
it.
Bottom line - use the correct tool for the job. Like the saying goes, "When
all you have is a hammer, everything looks like a nail".
--
Jeff Wilson
President
The Boolean Group, Inc.
(xxx) xxx-xxxx
Glendale, CA
"Dinh, Quang" <quang.dinh@i...> wrote in message
news:67680@s..._language...
>
> Hi,
>
> I have a web page that allows users to enter a keyword or phrase to search
> in my database. I use the LIKE '%" & sCriteria & "%' " to execute the
> search. If I want to allow them using the AND/OR within the search
string,
> how do I do that? I know the string must be broken up and rejoin with the
> appropriate AND/OR, but not sure how the source code would be like.
>
> Thanks.
>
> - quang
>
>
>