3、建立环境
打开查询分析器-->执行下列脚本:
--------------------------------------------
create database test ---创建test数据库
use test ---选择test数据库
create table dali (ID int not null primary key,MyImage image,FileType varchar(255),FileNmae varchar(255)) ---创建dali表
--dali表中 Id,MyImage,FileType 三列是必须的,因为要对image列索引的话,必须要有一个主键列,一个image列,一个存放文件类型的列
--我们知道在windows系统中文件类型是靠扩展名来区分的所以FileType列也就是用来放 文件的扩展名
--------------------------------------------
declare @Key sysname ; select @Key=c.name from syscolumns a,sysconstraints b,sysobjects c where a.id=object_id('a') and a.name='a' and a.id=b.id and b.constid=c.id and c.name like 'PK%'
exec sp_fulltext_table 'dali','create','My_FullDir',@Key ----这两句是为全文索引,对表进行标记