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''
go
exec 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"'')
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
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |