Re: Optional CONTAINS
From: John Kane (jt-kane_at_comcast.net)
Date: 04/23/04
- Next message: John Kane: "Re: what ports and protocols needed for ft?"
- Previous message: Mike Walsh: "Re: FullText catalog of wss - SQL 2000"
- In reply to: Matias Woloski: "Optional CONTAINS"
- Next in thread: Matias Woloski: "Re: Optional CONTAINS"
- Reply: Matias Woloski: "Re: Optional CONTAINS"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Apr 2004 09:47:46 -0700
Matias,
I'm not sure if a CASE construct can be used is such as you describe below,
but you might want to instead consider an IF... THEN ...ELSE construct, for
example:
-- FTS and IF/THEN/ELSE construct
Declare @searchstring varchar(255)
if(@param1 = '')
SELECT * FROM address
else
SELECT * FROM address WHERE CONTAINS(name, @searchstring)
Regards,
John
"Matias Woloski" <woloski@NO.SPAMsion.com> wrote in message
news:urzmDWUKEHA.1000@TK2MSFTNGP11.phx.gbl...
> Hi guys,
>
> I'm using FTS on sql server 2000
>
> I would like to write a stored proc that accepts conditional CONTAINS.
This
> means that if @param1 was provided I want to apply CONTAINS with certain
> column if not apply it to the other column
>
> WHERE
>
> CASE
>
> WHEN @param2 IS NULL THEN CONTAINS(param1, @param1)
>
> ELSE CONTAINS(param2, @param2)
>
> END
>
> Something like that I would like to do... But something that works ;)
>
> Thanks,
>
> Matias
>
>
>
- Next message: John Kane: "Re: what ports and protocols needed for ft?"
- Previous message: Mike Walsh: "Re: FullText catalog of wss - SQL 2000"
- In reply to: Matias Woloski: "Optional CONTAINS"
- Next in thread: Matias Woloski: "Re: Optional CONTAINS"
- Reply: Matias Woloski: "Re: Optional CONTAINS"
- Messages sorted by: [ date ] [ thread ]