sql server 2005 创建完视图,不能建索引,解决如下:(注:View_report新建的视图,Report数据表)
1:运行下面语句:
ALTER VIEW [dbo].[View_report] WITH SCHEMABINDING
AS
SELECT ID, UserID, Keyword, Ranking, Type, Url, UpdateTime, KeywordCount, BaiduCount, BaiduMCount, KeywordLen
FROM dbo.Report
2:再运行如下语句:
CREATE UNIQUE CLUSTERED INDEX [vix_id] ON [dbo].[View_report]
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
3:就可以创建全文索引,索引
红线处自己设置,其他默认。
创建全文索引后可用:contains(keyword,'三级')这个过滤