Fulltext_Index SQL

 

USE [RCA]

GO

execute sp_fulltext_database 'enable'

GO

execute sp_fulltext_catalog 'CUSTOMER_NAMECN','create'

GO

execute sp_fulltext_table 'RCA_Customer_Master',

'create','CUSTOMER_NAMECN','PK_RCA_Customer_Master'

GO

execute sp_fulltext_column 'RCA_Customer_Master',

'Chinese_Cust_name','add'

GO

execute sp_fulltext_table 'RCA_Customer_Master','activate'

GO

execute sp_fulltext_catalog 'CUSTOMER_NAMECN','start_full'

GO

 

Then manually configure the full text catalogs according to below enclosed screenshot:

                       

  1. Select ‘Simplified Chinese’      as language for broker
  2. Set ‘Automatic’ for Track      Changes

 

 

Demo:

 

CREATE DATABASE TESTFT COLLATE Chinese_PRC_CI_AS     

GO

 

execute sp_fulltext_database 'enable'

GO

execute sp_fulltext_catalog 'CUSTOMER_NAMECN','create'

GO

 

CREATE TABLE TB         

    ID INT IDENTITY(1,1), 

    Body VARCHAR(1000), 

    CONSTRAINT PK_TB PRIMARY KEY CLUSTERED (ID) 

GO 

 

 

--插入两行演示数据

delete TB

 

INSERT TB(Body) VALUES(N'亚是深受人民群众喜爱的著名艺术家') 

INSERT TB(Body) VALUES(N'宁夏固原有一位网友给敬爱的李老师写了一封信') 

 

 

execute sp_fulltext_table 'TB',

'create','CUSTOMER_NAMECN','PK_TB'

GO

 

 

execute sp_fulltext_column 'TB',

'Body','add'

GO

 

 

execute sp_fulltext_table 'TB','activate'

GO

execute sp_fulltext_catalog 'CUSTOMER_NAMECN','start_full'

GO

 

 

select * from  TB where  CONTAINS(Body,'老师')

 

posted @ 2016-06-23 18:11  光阴的故事-SKY  阅读(138)  评论(0编辑  收藏  举报