I have the following query. There are two possible columns that may hold the value I'm looking for, let's call them FieldA
and FieldB
.
If I execute this:
SELECT COUNT(1)
FROM Table
WHERE CONTAINS(Table.*, 'string')
I get back "0".
However, if I execute this:
SELECT COUNT(1)
FROM TABLE
WHERE FieldA LIKE '%string%' OR FieldB LIKE '%string%'
I get back something like 9000. I then checked and there are rows that have the word string
in either FieldA
.
Why does this happen? I recall that CONTAINS
uses a full-text index, but I also recall that LIKE
does the same, so if the problem was that the indexes are outdated, then it should fail for both of them, right?
Thanks