DC G,
You need to use the double quotes correctly... See KB article 246800
(Q246800) "INF: Correctly Parsing Quotation Marks in FTS Queries" at
http://support.microsoft.com//default.aspx?scid=kb;EN-US;246800 for FTS
query examples without an @variable...
I tried the following query using the pubs table pub_info with the
FT-enabled and populated column pr_info
declare @keywords varchar(25)
set @keywords = ' "word1 word2" '
SELECT pub_id, pr_info
from pub_info where contains(pr_info,@keywords)
/* -- expected results as word1 or word2 does not exist it this column
pub_id pr_info
------ -------------
(0 row(s) affected)
*/
I tested this on a Win2003 Server with SQL Server 2000 installed. Could you
post the full output of SELECT @@version as well as FT-enable the pubs
table pub_info and run a Full population and test the above query?
Thanks,
John
--
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/ [quoted text, click to view] "DC Gringo" <dcgringo@visiontechnology.net> wrote in message
news:u2$o053nFHA.708@TK2MSFTNGP09.phx.gbl...
> I have a CONTAINS search on a full-text index and I'm having trouble
running
> it on multiple terms without using an operator like AND or OR.
>
> Here is my search query:
>
> SELECT id
> FROM table1
> WHERE CONTAINS(column1,@keywords)
>
>
> These work as they should:
>
> declare @keywords varchar(25)
> set @keywords = ' "word1 and word2" '
>
> declare @keywords varchar(25)
> set @keywords = ' "word1 or word2" '
>
>
> ...and this:
>
> declare @keywords varchar(25)
> set @keywords = ' "word1 word2" '
>
> yields an error:
>
> Syntax error occurred near 'failure'. Expected ''''' in search condition
>
> Help!
>
>
> _____
> DC G
>
>
>