Anoop
Anoop

Reputation: 2101

Attach and detach database

When i attach a Northwind database(using sp_attach_db) to SQL server 2005 ,it finished successfully. but when i run this query

SELECT FT_TBL.Description, 
   FT_TBL.CategoryName, 
   KEY_TBL.RANK
FROM Categories AS FT_TBL INNER JOIN
   CONTAINSTABLE (Categories, Description, 
      '("sweet and savory" NEAR sauces) OR
      ("sweet and savory" NEAR candies)'
      , 10
   ) AS KEY_TBL
   ON FT_TBL.CategoryID = KEY_TBL.[KEY]

it is giving me this error

"Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Categories' because it is not full-text indexed."

what will be the possible solution? Do we Need to create a Full -Text index?

please help me thanks in advance

Upvotes: 0

Views: 194

Answers (1)

Roberto Hernandez
Roberto Hernandez

Reputation: 2427

Yes, in order to use CONTAINSTABLE the table needs to have a Full-Text Index defined on it.

Upvotes: 2

Related Questions