--设置全文索引列名
exec sp_fulltext_column 'FreeText', 'Subject', 'add'
go
exec sp_fulltext_column 'FreeText', 'Contents', 'add'
go
--建立全文索引
exec sp_fulltext_table 'FreeText', 'activate'
go
--填充全文索引目录
exec sp_fulltext_catalog 'Cat_Demo', 'start_full'
go
--使用contains和freetext
select Subject, Contents from [FreeText]
where contains(Subject, '"star"')
go
select Subject, Contents from [FreeText]
where freetext(Subject,Contents 'bb')
go
select Subject, Contents from [FreeText]
where freetext(*, '"star"')
go
select Subject, Contents from [FreeText]
where contains(*, 'aa ')
go
select title, notes from titles
where freetext (*, 'computer')
go