例項演示在MSSQL中啟用全文檢索

2021-04-17 06:39:39 字數 1535 閱讀 8377

如何在sql

中啟用全文檢索功能?本文將通過例項向你剖折這個問題。這是乙個全文索引的乙個例子,首先在查詢分析器中使用:

www.c hinaitpower.coml1odlwyq

use pubs

go www.c hinaitpower.coml1odlwyq

--開啟資料庫全文索引的支援www.c hinaitpower.coml1odlwyq

execute sp_fulltext_database ''enable''

go www.c hinaitpower.coml1odlwyq

--建立全文目錄ft_titles

execute sp_fulltext_catalog ''ft_titles'', ''create''

go www.c hinaitpower.coml1odlwyq

--為titles表建立全文索引資料元,upkcl_titleidind是主鍵所建立的唯一索引,可由sp_help titles得知

execute sp_fulltext_table ''titles'',''create'', ''ft_titles'', ''upkcl_titleidind''

go www.c hinaitpower.coml1odlwyq

--設定全文索引列名

exec sp_fulltext_column ''titles'', ''title'', ''add''

goexec sp_fulltext_column ''titles'', ''notes'', ''add''

go www.c hinaitpower.coml1odlwyq

--建立全文索引

exec sp_fulltext_table ''titles'', ''activate''

go www.c hinaitpower.coml1odlwyq

--填充全文索引目錄

exec sp_fulltext_catalog ''ft_titles'', ''start_full''

go www.c hinaitpower.coml1odlwyq

--使用contains和freetext

select title, notes from titles

where contains(title, ''"computer cooking"'')

goselect title, notes from titles

where freetext(title, ''computer cooking'')

goselect title, notes from titles

where freetext(title, ''"computer cooking"'')

goselect title, notes from titles

where contains(title, ''computer'')

goselect title, notes from titles

where freetext (*, ''computer'')go

例項演示在SQL中啟用全文檢索

doctype html public wcdtd xhtml stricten httpwwwworgtrxhtmldtdxhtml strictdtd 如何在sql中啟用全文檢索功能?本文將通過例項向你剖折這個問題。這是乙個全文索引的乙個例子,首先在查詢分析器中使用 use pubs go 開啟...

SQL Server全文索引的使用例項演示

本文示範完整的sql server資料庫全文索引以pubs資料庫為例 首先,介紹利用系統儲存過程建立全文索引的具體步驟 1 啟動資料庫的全文處理功能 nbs程式設計客棧p sp fulltext database 2 建立全文目錄 n程式設計客棧bsp sp fulltext catalog 3 在...

怎樣在Nginxserver中啟用Gzip壓縮

enable gzip compression on nginx servers 原文日期 2014年7月16日 翻譯日期 2014年7月19日 翻譯人員 鐵錨速度決定一切,沒有什麼比乙個快速站點更犀利的了。當你訪問我的部落格時,我希望你有乙個良好的體驗,這也是我一直不知疲倦地壓縮全部資源和避免不必...