How can i search for a string value in a sql server varbinary column

I want to have a power search facility in my application.
I am storing doc files in a varbinary(max) column in sql server 2005 database.
Can i compare a string value passed from the front end to the sql server and check whether the doc file stored in the binary format in the database contains the passed string.
SukeshjphAsked:
Who is Participating?
 
SteveH_UKConnect With a Mentor Commented:
OK.  So once you have the index created (and you have configured the table with a column indicating the file extension, in this case .doc), you can use this command:

SELECT [YourColumn] FROM [YourTable]
WHERE CONTAINS (YourVarBinary, ' "word pattern" ')

See these references:
http://msdn2.microsoft.com/en-us/library/ms142531.aspx (Query varbinary(max))
http://msdn2.microsoft.com/en-us/library/ms142559.aspx (Full text queries)


0
 
SteveH_UKCommented:
The doc files cannot be searched directly.  You need to create a full text index on the table.

See http://msdn2.microsoft.com/en-us/library/ms142497.aspx.
0
 
SukeshjphAuthor Commented:
Can i accomplish my task  any other way...because i don't have permission to do indexing in my database...can i convert the string to byte array and have a search in the varbinary column in the sql server database...
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
SteveH_UKCommented:
Not for searching within a .DOC file.  The content is encoded.
0
 
SukeshjphAuthor Commented:
I enabled the full text search in my  varbinary(max) column now what is the next step to search the passed string in the .doc file stored in this column.
0
 
SteveH_UKCommented:
Thanks for the points :)
0
All Courses

From novice to tech pro — start learning today.