实例演示在SQL数据库中启用全文检索
http://tech.ddvip.com 2007年05月15日 社区交流
本文详细介绍实例演示在SQL数据库中启用全文检索
如何在SQL中启用全文检索功能?本文将通过实例向你剖折这个问题
这是一个全文索引的一个例子,首先在查询分析器中使用:e pubs
go
打开数据库全文索引的支持ute sp_fulltext_database 'enable'
go
建立全文目录ft_titlesute sp_fulltext_catalog 'ft_titles', 'create'
go
为titles表建立全文索引数据元,UPKCL_titleidind是主键所建立的唯一索引,可由sp_help titles得知cute 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和freetextselect 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 Server 2008 教程
- SQL Server 2005 教程
- SQL Server 安全设置
- SQL Server 故障解决
- SQL Server 安装配置
- SQL Server 备份恢复
- SQL Server 性能调优
- SQL Server 存储过程
- SQL Server 函数
- SQL Server 事务
- SQL Server 查询
- SQL Server 索引
- SQL Server 入门教程
- SQL Server 数据类型
- SQL Server 数据库表
- SQL Server T-SQL
- SQL Server 语句
- SQL Server 死锁
- SQL Server 加密
- SQL Server 数据库连接
- SQL Server 数据仓库
- SQL Server 数据库管理
- 更多SQL Server 专题>>>