日期:2014-05-17 浏览次数:20627 次
create database DBAP
use DBAP
create table tb5
( tsid int not null,
tsde char(8000),
descr varchar(30)
constraint pk_tb5 primary key clustered(tsid)
)
create index idx_tb5_descr on tb5(descr)
set nocount on
declare @x int=1
while @x<=100000
begin
insert into tb5(tsid,tsde,descr)
values(@x,'313ccx',rtrim(@x)+'cxccx')
select @x=@x+1
end
set nocount off
if(select databaseproperty('DBAP','isfulltextenabled'))=0
execute sp_fulltext_database 'enable'
execute sp_fulltext_catalog 'ft_pubs','create','D:\sqldata\ft'
execute sp_fulltext_table 'tb5','create','ft_pubs','pk_tb5'
execute sp_fulltext_column 'tb5','descr','add'
execute sp_fulltext_table 'tb5','activate'
execute sp_fulltext_catalog 'ft_pubs','start_full'
while fulltextcatalogproperty('ft_pubs','populateStatus')<>0
begin
waitfor delay '00:00:05'
end
--问题..为何总是返回0呢?
select count(1)
from tb5
where contains(descr,'35')