Hello folks,
I have a table with several FT-enabled varchar columns, in SQL Server
2000.
If I ask for SELECT * FROM tbl WHERE CONTAINS(*, SearchStringA) I get
several rows. (as expected)
If I ask SELECT * FROM tbl WHERE CONTAINS(*, SearchStringB) I also get
several rows and they are an overlapping set of rows. (also as expected)
However, if I ask for SELECT * FROM tbl WHERE CONTAINS(*, SearchStringA AND
SearchStringB) I get no rows. The two seperate searches find matches in
different columns. Is this the problem, and if so, what is the best way to
get a correct result?
Thanks in advance,
Martin
Hilary Cotter - 31 May 2005 03:56 GMT
If you want to look across columns you would have to do a FreeText query,
however with contains you would have to do this
select * from tablename where contains(col1, 'SearchPhraseA') or
contains(col2,'SearchPhraseB')

Signature
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
> Hello folks,
> I have a table with several FT-enabled varchar columns, in SQL Server
[quoted text clipped - 13 lines]
> Thanks in advance,
> Martin