


實(shí)例演示在MSSQL中啟用全文檢索
如何在SQL中啟用全文檢索功能?本文將通過實(shí)例向你剖折這個(gè)問題。這是一個(gè)全文索引的一個(gè)例子,首先在查詢分析器中使用:
use pubs
go
--打開數(shù)據(jù)庫全文索引的支持
execute sp_fulltext_database ''enable''
go
--建立全文目錄ft_titles
execute sp_fulltext_catalog ''ft_titles'', ''create''
go
--為titles表建立全文索引數(shù)據(jù)元,UPKCL_titleidind是主鍵所建立的唯一索引,可由sp_help titles得知
execute sp_fulltext_table ''titles'',''create'', ''ft_titles'', ''UPKCL_titleidind''
go
--設(shè)置全文索引列名
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
關(guān)鍵字:全文檢索、MSSQL
新文章:
- CentOS7下圖形配置網(wǎng)絡(luò)的方法
- CentOS 7如何添加刪除用戶
- 如何解決centos7雙系統(tǒng)后丟失windows啟動項(xiàng)
- CentOS單網(wǎng)卡如何批量添加不同IP段
- CentOS下iconv命令的介紹
- Centos7 SSH密鑰登陸及密碼密鑰雙重驗(yàn)證詳解
- CentOS 7.1添加刪除用戶的方法
- CentOS查找/掃描局域網(wǎng)打印機(jī)IP講解
- CentOS7使用hostapd實(shí)現(xiàn)無AP模式的詳解
- su命令不能切換root的解決方法
- 解決VMware下CentOS7網(wǎng)絡(luò)重啟出錯(cuò)
- 解決Centos7雙系統(tǒng)后丟失windows啟動項(xiàng)
- CentOS下如何避免文件覆蓋
- CentOS7和CentOS6系統(tǒng)有什么不同呢
- Centos 6.6默認(rèn)iptable規(guī)則詳解