日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

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

發布時間:2023/12/20 数据库 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 实例演示在SQL中启用全文检索 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd>

如何在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
#數據庫技術

總結

以上是生活随笔為你收集整理的实例演示在SQL中启用全文检索的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。