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:
- Select ‘Simplified Chinese’ as language for broker
- 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,'老师')