--在执行该脚本程序之前启动sql server的全文搜索服务,即microsoft search服务
use huarui_db --打开数据库
go
--检查huarui_db是否支持全文索引,如果不支持全文索引,则使用sp_fulltext_datebase打开该功能
if (select databaseproperty ('huarui_db','IsFulltextEnables'))=0
execute sp_fulltext_database 'enable'
--建立全文目录FullText_huarui_db
execute sp_fulltext_catalog 'FullText_huarui_db','create'
--为Products表建立全文索引数据元
execute sp_fulltext_table 'Products','create','FullText_huarui_db','PK_Products' --设置全文索引列名
execute sp_fulltext_column 'Products','Product_name','add'
execute sp_fulltext_column 'Products','Product_type','add'
execute sp_fulltext_column 'Products','Category_name','add'
execute sp_fulltext_column 'Products','Memo1','add'
--建立全文索引
--execute sp_fulltext_table 'FullText_huarui_db','activate'
--填充全文索引目录
execute sp_fulltext_catalog 'FullText_huarui_db','start_full' GO
--检查全文目录填充情况
WHILE FulltextCatalogProperty('FullText_huarui_db','PopulateStatus')<>0
BEGIN
--如果全文目录正处于填充状态,则等待30秒后再检测一次
WAITFOR DELAY '0:0:30'
END
--全文目录填充完成后,使用全文目录检索
--查询title列或notes列中包含有database或computer字符串的图书名称
SELECT *
FROM Products
where contains(Product_name,'%1806%')
or contains(Product_type,'%1806%')

  

最新文章

  1. Magnifier笔记
  2. Java中基本数据类型的对比记忆
  3. U-Boot命令大全(功能参数及用法)
  4. [Effective JavaScript 笔记]第49条:数组迭代要优先使用for循环而不是for...in循环
  5. 免杀ASP一句话
  6. foreach 相关
  7. expect批量分发公钥
  8. BZOJ 1015 [JSOI2008]星球大战starwar
  9. CLR执行模型与常见的几个概念
  10. node环境安装(mac版和windows版)
  11. CentOS(linux发行版)系统安装中文输入法:
  12. Windows 10 安装 Docker for Windows
  13. 点击table中的某一个td,获得这个tr的所有数据
  14. C# 小算法1
  15. docker+elasticsearch的安装
  16. freeRTOS中文实用教程3--中断管理之延迟中断处理
  17. 揭开Future的神秘面纱——任务执行
  18. MVC的注意事项及开发技巧
  19. python编辑选课系统
  20. 17monipdb根据IP获得区域

热门文章

  1. Rocchio算法
  2. 机器学习12—FP-growth学习笔记
  3. centos 6.9使用Rsync+Inotify-tools实现数据实时同步
  4. 好文章收藏--五分钟理解一致性哈希算法(consistent hashing)
  5. 从零开始学android -- Service
  6. 转:MSSQL SERVER行转列 列转行
  7. EasyUI入门视频教程
  8. AliRedis性能
  9. 如何创建AnjularJS项目
  10. EasyNVR流媒体直播之:零基础实现摄像头的全平台直播 (二)公网直播的实现