问题描述
我有一个数据库表,主列定义为:
ID bigint标识主键
code>
我也有一个文本列 MiddlePart
。我试图创建一个全文索引,如下所示:
CREATE FULLTEXT INDEX ON domaining.dbo.DomainName
(
MiddlePart
语言0X0
)
KEY索引ID on domaincatalog
WITH CHANGE_TRACKING AUTO
我得到这个错误:
'ID'不是强制执行全文搜索关键字的有效索引。全文搜索键必须是唯一的,不可空的单列索引,该索引不脱机,未在非确定性或不精确的非计算列上定义,没有过滤器,最大大小为900字节。为全文键选择另一个索引。
我做错了什么?
在KEY INDEX之后,您需要指定索引的名称而不是列。要在列ID中找到索引的名称,请键入 sp_help DomainName
,并且该表上会有一个索引列表。 PK将被命名为PK_xxxxx。使用该索引名称而不是ID。
I have a database table with the primary column defined as:
ID bigint identity primary key
I also have a text column MiddlePart
. I'm trying to create a full text index, like so:
CREATE FULLTEXT INDEX ON domaining.dbo.DomainName
(
MiddlePart
Language 0X0
)
KEY INDEX ID ON domaincatalog
WITH CHANGE_TRACKING AUTO
I get this error:
'ID' is not a valid index to enforce a full-text search key. A full-text search key must be a unique, non-nullable, single-column index which is not offline, is not defined on a non-deterministic or imprecise nonpersisted computed column, does not have a filter, and has maximum size of 900 bytes. Choose another index for the full-text key.
What am I doing wrong?
After KEY INDEX, you need to specify the name of the index not the column. To find the name of the index on the column ID, type sp_help DomainName
and there will be a list of indexes on that table. The pk will be named something like PK_xxxxx. Use that index name instead of "ID".
这篇关于为什么我无法创建这个sql server全文索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!