June 17, 2008 at 1:13 am
Hi,
I have a Table which holds varbinary column(word document). I need to search few keywords in this column.
How to use PatIndex on varbinary column?
Thanks,
Uma Ramiya
June 17, 2008 at 11:12 pm
Open a Word document in a text editor like Notepad and let me know if you think a search for any word would actually work...;)
--Jeff Moden
Change is inevitable... Change for the better is not.
June 18, 2008 at 3:00 am
I found a solution through another form member. for those who have the same issue please go thru the following link
June 18, 2008 at 7:24 am
Thanks for sharing...
But that's still going to have the same problem as PatIndex... For example... if you're looking for the word "GUID" or the word "DEFAULT" in a word document, you'll find that ALL word documents contain those words.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 18, 2008 at 8:16 am
Try something like this (adapted to your environment):
Declare @s-2 varchar(256),@v varbinary(256)
Select
@s-2='String with wierdness'+Char(127)+' in it...',
@v-2=cast(@s as varbinary)
Print @s-2
Print @v-2
Print patindex('%'+Char(127)+'%',cast(@v as varchar))
I've run into cases where the above PATINDEX may need to be augmented with a COLLATE predicate; I usually use collation "Latin1_General_BIN" in that case.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply