sql 2005中全文索引的使用

/*打开全文索引支持,启动SQL Server的全文搜索服务 */
execute sp_fulltext_database ‘enable’ 
/*创建全文目录*/
EXEC SP_FULLTEXT_CATALOG 'FT_testData','CREATE'
/*建立全文索引数据元*/
EXEC sp_fulltext_table 'Hc_Book_Book','CREATE','FT_testData','PK_Hc_Book_BookInfo'
/*添加支持全文索引的列名*/
EXEC sp_fulltext_column 'Hc_Book_Book','BookName','add'
EXEC sp_fulltext_column 'Hc_Book_Book','BookISBN','add'
/*为表创建(激活)全文索引*/
EXEC sp_fulltext_table 'Hc_Book_Book','activate'
/*启动对全文目录的完全填充*/
EXEC sp_fulltext_catalog 'FT_testData','start_full'
/*验证全文目录填充的进度*/
select fulltextcatalogproperty('FT_testData','populateStatus') 

select * FROM Hc_Book_Book WHERE CONTAINS(BookName,'java')

 

posted @ 2013-06-08 13:16  唐学阳  阅读(253)  评论(0编辑  收藏  举报