正文

 如何在SQL中启用全文检索功能?2007-01-30 10:18:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/Csharpsky/22968.html

分享到:

如何在SQL中启用全文检索功能? -------------------------------------------------------------------------------- 全文索引的一个例子,在查询分析器中使用:use pubsgo--打开数据库全文索引的支持execute sp_fulltext_database 'enable'go--建立全文目录ft_titlesexecute 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'goexec sp_fulltext_column 'titles', 'notes', 'add'go--建立全文索引exec sp_fulltext_table 'titles', 'activate'go--填充全文索引目录exec sp_fulltext_catalog 'ft_titles', 'start_full'go--使用contains和freetextselect title, notes from titleswhere contains(title, '"computer Cooking"')goselect title, notes from titleswhere freetext(title, 'computer Cooking')goselect title, notes from titleswhere freetext(title, '"computer Cooking"')goselect title, notes from titleswhere contains(title, 'computer')goselect title, notes from titleswhere freetext (*, 'computer')go

阅读(2258) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册