| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 977 人关注过本帖
标题:实例演示在MSSQL中启用全文检索
只看楼主 加入收藏
maq000
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-10-10
收藏
 问题点数:0 回复次数:0 
实例演示在MSSQL中启用全文检索
如何在SQL中启用全文检索功能?本文将通过实例向你剖折这个问题。这是一个全文索引的一个例子,首先在查询分析器中使用:
  use pubs
  go
  --打开数据库全文索引的支持
 execute sp_fulltext_database ''enable''
 go
  --建立全文目录ft_titles
  execute sp_fulltext_catalog ''ft_titles'', ''create''
  go
  --为titles表建立全文索引数据元,UPKCL_titleidind是主键所建立的唯一索引,可由sp_help titles得知
  execute sp_fulltext_table ''titles'',''create'', ''ft_titles'', ''UPKCL_titleidind''
  go
  --设置全文索引列名
  exec sp_fulltext_column ''titles'', ''title'', ''add''
  go
  exec sp_fulltext_column ''titles'', ''notes'', ''add''
  go
  --建立全文索引http://www.
  exec sp_fulltext_table ''titles'', ''activate''
  go
  --填充全文索引目录
  exec sp_fulltext_catalog ''ft_titles'', ''start_full''
  go
  --使用contains和freetext
  select title, notes from titles
  where contains(title, ''"computer Cooking"'')
  go
  select title, notes from titles
  where freetext(title, ''computer Cooking'')
  go
  select title, notes from titles
  where freetext(title, ''"computer Cooking"'')
  go
  select title, notes from titles
  where contains(title, ''computer'')
  go
  select title, notes from titles
  where freetext (*, ''computer'')
  go
这样有错吗?不是很清楚,各位评一下~~
搜索更多相关主题的帖子: MSSQL 实例 全文 演示 检索 
2008-10-10 15:30
快速回复:实例演示在MSSQL中启用全文检索
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.010975 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved