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 2005 Forums
 Transact-SQL (2005)
 Contains not working properly with AND

Author  Topic 

sandeep.kumar
Starting Member

7 Posts

Posted - 2011-10-20 : 09:09:48
Hi All,

I have a SQL table, which has been indexed and Full text search enabled.

I am executing the following command

Select * from table where contains(*, 'XXXX and YYYYY')
it works..

But when I am replacing "YYYYY" word with another word from same column it doest show result. Although I am providing the value which is coming for top result.

Select * from table where contains(*, 'XXXX and "AAA BBBB"')
It doesnt work.

Please help me.

Regards
Sandy

Sachin.Nand

2937 Posts

Posted - 2011-10-22 : 13:26:42
Not sure but shouldn't it be

Select * from table where contains(*, 'XXXX and AAA BBBB')

instead of
Select * from table where contains(*, 'XXXX and "AAA BBBB"')



PBUH

Go to Top of Page

sandeep.kumar
Starting Member

7 Posts

Posted - 2011-10-25 : 07:15:39
Hi,

It can be executed as below only:

Select * from table where contains(*, 'XXXX and "AAA BBBB"')

Not like
Select * from table where contains(*, 'XXXX and AAA BBBB')
With this line it gives error.
Regards
Sandy

quote:
Originally posted by Sachin.Nand

Not sure but shouldn't it be

Select * from table where contains(*, 'XXXX and AAA BBBB')

instead of
Select * from table where contains(*, 'XXXX and "AAA BBBB"')



PBUH



Go to Top of Page
   

- Advertisement -