Friday, February 24, 2012

CREATE FTC Failing for

Trying to create a catalog as seen below:

CREATE FULLTEXT INDEX ON [dbo].[AttachFiles](

[BinFile])

KEY INDEX [PK_AttachFiles] ON [Dossiers_FTC]

WITH CHANGE_TRACKING OFF

GO

Getting error of:

Msg 7655, Level 16, State 1, Line 1

TYPE COLUMN option must be specified with column of image or varbinary(max) type.

BinFile is an Image datatype.

What do I need to update on my CREATE statement above to make this work?

When you use an IMAGE or VARBINARY(MAX) field for a full-text index, you have to tell the service how to read the binary image. It has a set of extensions installed with which it can read these. You can see the list by executing a "SELECT * FROM sys.fulltext_document_types" query in the full-text enabled database. To tell the service what image type is stored in the field, you need another field that holds the type name.

So, let's assume Dossiers_FTC holds MS Word Document files. Let's also assume you have a field in your table named "BinType" that contains the string ".doc". Your statement would look like this:

CREATE FULLTEXT INDEX ON [dbo].[AttachFiles]

([BinFile] TYPE COLUMN [BinType]) KEY INDEX [PK_AttachFiles] ON [Dossiers_FTC]

WITH CHANGE_TRACKING OFF

GO

No comments:

Post a Comment