Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 free text in a varbinary(max) column

Author  Topic 

Oliver wang
Yak Posting Veteran

50 Posts

Posted - 2012-05-22 : 05:27:46
Hi Everybody,

I have inserted a English paragraph in a varbinary(max) type column and it is now showing like "0x536569736D69632044617461......". I used the following scripts to get the items I need:

SELECT *
FROM records
WHERE CONTAINS(chart, N'limitation')
GO

"limitation" exits in the English paragraph, but I got nothing after executing the query. Does anybody know how to make it work? Thank you very much.

Regards,

Oliver

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-05-22 : 11:55:12
can you please show us the schema of records?

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-05-22 : 12:35:16
When storing it in binary columns you have to specify a filter for the FT indexing engine to identify the type of data. More information here:

http://goo.gl/Nlu4M

You'd have to indicate that this data is a .txt document type and rebuild your full-text index.
Go to Top of Page

Oliver wang
Yak Posting Veteran

50 Posts

Posted - 2012-05-22 : 23:49:41
Hi robvolk,

Thanks for your response, actually in the table I do have a column to store file type such as ".doc". Is it possible to do some changes directly on my scripts so it will be easy to understand?

Hi yosiasz,

the schema of the table is dbo. The table structure is as below:
CREATE TABLE [dbo].[Records](
[Id] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[SerialNumber] [int] NULL,
[Chart] [varbinary](max) FILESTREAM NULL,
[type_column] [varchar](20) NULL,
)

regards,

Oliver
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-05-23 : 15:12:53
check this out wonder if it will help

http://arcanecode.com/2009/05/28/full-text-searching-a-filestream-varbinary-max-column/

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

Oliver wang
Yak Posting Veteran

50 Posts

Posted - 2012-05-23 : 23:26:22
Thank you very much, yosiasz. Your link is really useful~
Go to Top of Page
   

- Advertisement -