使列与Full兼容
我尝试在我的表上创建一个全文索引,它说我首先需要全文索引的列。 那是什么意思?
我所有的列都是varchar或nvarchar(允许为空)。
这是我遵循的教程:
http://blog.sqlauthority.com/2008/09/05/sql-server-creating-full-text-catalog-and-index/
我无法告诉你做错了什么和你在哪里。
首先转到您的服务,看看您是否安装了全文服务,如果已安装,请确保它处于Running
。
一旦你确认了它,它就在那里并且正在运行,你可以按照以下步骤在表格上创建一个FTS索引
/*A Table with A Primary key Defined on a column*/
CREATE TABLE Test_FTS
(ID INT PRIMARY KEY NOT NULL
,Column1 NVARCHAR(100)
,Column2 VARCHAR(100))
GO
/*
Your Table have to have a PRIMARY KEY or atleast a Unique Index defined on any
column in your table.
Basicaly this Unique Index/Primary Key value will be stored in your FTS
working as a POINTER to the data in your table.
*/
/* Only create a Unique Index if you do not have a Primary Key in your table*/
CREATE UNIQUE INDEX UIX_SomeUniqueIdex ON dbo.Test_FTS(ID);
GO
/*Create a Catalog*/
CREATE FULLTEXT CATALOG FTS_Test_Catalog AS DEFAULT;
GO
/* Finally the FTS Index */
CREATE FULLTEXT INDEX ON Test_FTS (Column1)
KEY INDEX UIX_SomeUniqueIdex;
GO
链接地址: http://www.djcxy.com/p/66853.html