国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

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

2024-07-21 02:06:17
字體:
來源:轉載
供稿:網(wǎng)友
  • 網(wǎng)站運營seo文章大全
  • 提供全面的站長運營經(jīng)驗及seo技術!
  •  如何在sql中啟用全文檢索功能?本文將通過實例向你剖折這個問題。這是一個全文索引的一個例子,首先在查詢分析器中使用:
       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

      --設置全文索引列名

       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
    發(fā)表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發(fā)表
    主站蜘蛛池模板: 台中县| 武夷山市| 永川市| 历史| 中山市| 阜城县| 聊城市| 宜兰市| 文安县| 马边| 碌曲县| 杭锦后旗| 左云县| 共和县| 邹城市| 常州市| 海淀区| 清镇市| 牡丹江市| 辉县市| 米泉市| 麻城市| 侯马市| 乐山市| 中方县| 肃北| 永修县| 抚顺县| 斗六市| 鞍山市| 利辛县| 台山市| 天全县| 古浪县| 晋中市| 女性| 揭东县| 镇赉县| 环江| 洪江市| 通州市|