这是我得到的错误:
Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'database.dbo.crm_main'
because it is not full-text indexed.
但我已经创建了它们,这是我使用的命令:
use [database]
create fulltext catalog FullTextCatalog as default
create fulltext index on [database].[dbo].[crm_main] key index PK_crm_main
ON FullTextCatalog WITH CHANGE_TRACKING AUTO
在创建过程中未遇到任何错误。我做错了什么?
这是我的sql语句:
SELECT TOP 1000 *
FROM [database].[dbo].[crm_main]
INNER JOIN FREETEXTTABLE ([database].[dbo].[crm_main], *, '%Wade%')
AS SEARCH_TABLE ON SEARCH_TABLE.[KEY] = crm_main.id
答案 0 :(得分:1)
你唯一的错误是你没有提到列名 在您的Create索引语句中,您希望在哪个列上 创建索引见下文。
create fulltext index
ON [dbo].[crm_main](Column1,Column2) --<-- you need to mention the column names
key index PK_ID -- on which you want to create FT indexes
ON FullTextCatalog
WITH CHANGE_TRACKING AUTO;