我在sql Server 2005中的视图上创建全文索引时遇到了麻烦.查看文档我没有发现问题.我收到的错误消息是:“’Id’不是强制执行全文搜索键的有效索引.全文搜索键必须是唯一的,不可为空的单列索引,它不是脱机的,是未在非确定性或不精确的非持久计算列上定义,并且最大大小为900字节.为全文键选择另一个索引.“
我已经能够验证errorstring中除了“离线”要求之外的所有要求,我不知道这意味着什么.我很确定它不会脱机.
我已经能够验证errorstring中除了“离线”要求之外的所有要求,我不知道这意味着什么.我很确定它不会脱机.
我有脚本来创建下面的目标表,视图和索引.我真的不需要下面的示例中的视图,它简化了,因为我试图隔离问题.
DROP VIEW [dbo].[ProductSearchView] DROP TABLE [dbo].[Product2] GO SET NUMERIC_ROUNDABORT OFF; SET ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL,ARITHABORT,QUOTED_IDENTIFIER,ANSI_NULLS ON; GO CREATE TABLE [dbo].[Product2]( [Id] [bigint] NOT NULL,[Description] [nvarchar](max) NULL,CONSTRAINT [PK_Product2] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF,IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO CREATE VIEW [dbo].[ProductSearchView] WITH SCHEMABINDING AS SELECT P.Id AS Id,P.Description AS Field FROM [dbo].Product2 AS P GO -- this index may be overkill given the PK is set... CREATE UNIQUE CLUSTERED INDEX PK_ProductSearchView ON [dbo].[ProductSearchView](Id) GO -- This is the command that fails CREATE FULLTEXT INDEX ON [dbo].[ProductSearchView](Id,Field) KEY INDEX Id ON FullText WITH CHANGE_TRACKING AUTO; GO