0
votes

Getting this error

Cannot use a CONTAINS or FREETEXT predicate on column 'data' because it is not full-text indexed.

When in SQL Server Management Studio I go into design of the table, right-click a column and select "Fulltext Index..." I can see that column "data" is in fact full-text indexed.

What's going on? I created the index using the wizard (right-clicked the table > full text index > define full text index...).

I've made sure I've populated the index fully.

1
Nevermind, you're right. It was in the query. Will post answer in a sec. - user3435078

1 Answers

0
votes

The problem was my SQL query. I was trying to use CONTAINS in a subtable.

Example:

SELECT * FROM
(SELECT * FROM realtbl WHERE CONTAINS(data,N'one')) AS [atbl]
WHERE CONTAINS(data,N'two')

The second contains searches in "atbl" and not the actual table in the database. The atbl doesn't have a full-text index while the realtbl does.

Of course my SQL wasn't near as simple as this example, which is why I missed that I had a subtable in there.