sqlserver 2005 full-text 的创建和使用

--前提如果sqlserver 2005 express 需要下载 SQLEXPR_ADV.EXE。安装Full-Text支持

--安装完了,FullText Search在Sqserver configuration Manager中的三个服务

中的Sql Server FullText Search中的账户 Log on as "Local System"

 

在查询分析器中

安下面步骤

--打开数据库

user donab

 --打开全文索引支持,启动SQL Server的全文搜索服务

execute sp_fulltext_database 'enable'

--建立全文检索目录donba_fulltext

execute sp_fulltext_catalog 'donba_fulltext', 'create','F:"donbafulltext'

为Title列建立全文索引数据元,ProductID为Product表中由主键所建立的唯一索引,这个参数是必需的。

execute sp_fulltext_table 'Product','Create','donba_fulltext','ProductID'

--设置全文索引列名

execute sp_fulltext_column 'Product', 'Name', 'add'

execute sp_fulltext_column 'Product','Summary', 'add'

execute sp_fulltext_column 'Product','Description', 'add'


--建立全文索引

execute sp_fulltext_table 'Product', 'activate'

--填充全文索引目录

execute sp_fulltext_catalog 'donba_fulltext', 'start_full'

--至此,全文索引建立完毕。

--查询
select [productid],[Name],[Description] from Product where contains(Name,'"IBM" and "thinkpad" and "A21"')


--select c1 from ftstable where contains(*,'"apples" and "oranges"')

转载于:https://www.cnblogs.com/guola/archive/2009/01/16/1376833.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值