客户专线:400-641-8864 / 153-2383-7083 | 在线QQ:987837344
首页 易当家ERP 鼎捷ERP 行业方案 实施方法 联系我们  
 

实例演示在MSSQL中启用全文检索


--实例演示在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

--建立全文索引

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




猜您喜欢:     易当家E9ERP     易当家E8ERP     微信公众号开发

ERP,ERP系统,ERP软件
ERP软件 | 鼎捷软件 | 神州数码 |
Copyright© 2008-2016 深圳市易当家软件开发有限公司. All Rights Reserved. 粤ICP备14043283号