全文检索配置示例:
(常见问题参考我的帖子: http://community.csdn.net/Expert/TopicView.asp?id=3295983)--建测试库
create database test collate Latin1_General_CI_AS
go--切换到测试库
use test
go--创设测试表
create table tb (ID int identity not null,a nvarchar(10),b varchar(10),constraint PK_tb primary key(id))
go--为全文索引启用数据库
exec sp_fulltext_database 'enable'--创建一个叫My_FullDif的全文目录
exec sp_fulltext_catalog 'My_FullDir', 'create' --为全文索引标记表
exec sp_fulltext_table 'tb','create','My_FullDir','PK_tb'--创建全文索引
exec sp_fulltext_column 'tb','a','add',0x0804
exec sp_fulltext_column 'tb','b','add',0x0804
go--插入数据(注意插入数据时,字段类型及N前导符对最终查询结果的影响)
insert tb select  '中国营农场', '中国营农场'
union all select N'中国营农场',N'中国营农场'
union all select  '中国营农场',N'中国营农场'
union all select N'中国营农场', '中国营农场'
go
--填充全文索引
exec sp_fulltext_table 'tb','start_full'--填充全文索引后,有一定的延迟时间才会生效,所以要延时
waitfor delay '00:00:10'
go--查询
select * from tb where contains(a,'"国营"')
select * from tb where contains(b,'"国营"')
select * from tb where contains(a,N'"国营"')
select * from tb where contains(b,N'"国营"')select * from tb
go--删除测试
use master
godrop database test
/*--测试结果ID          a          b          
----------- ---------- ---------- 
4           中国营农场      ?????
2           中国营农场      ?????(所影响的行数为 2 行)ID          a          b          
----------- ---------- ---------- (所影响的行数为 0 行)ID          a          b          
----------- ---------- ---------- 
4           中国营农场      ?????
2           中国营农场      ?????(所影响的行数为 2 行)ID          a          b          
----------- ---------- ---------- (所影响的行数为 0 行)--*/

解决方案 »

  1.   

    我的 版本是否支持 中文的全文检索呢??
    Microsoft SQL Server  2000 - 8.00.760 (Intel X86)   Dec 17 2002 14:22:05   Copyright (c) 1988-2003 Microsoft Corporation  Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4) 
      

  2.   


    我发现我的这个目录下根本没有noise.chs 这个文件 怎么回事??\Microsoft SQL Server\MSSQL\FTDATA\SQLServer\Config\