How to get number of occurrences in varbinary datatype?

  • I have a table with varbinary datatype (file stream enabled) column which store pdf files as binary , form that i can get result as which of file have 'invoice' word using following query.

    SELECT * FROM FileStore WHERE CONTAINS(Document,'invoice')

    Here "Document" is varbinary column which store pdf and word files as binary.

    From this i want to get words which appear how many times, i mean number of occurrences.

    E.G: In one of the pdf got 'invoice' word 5 times , so want to count how many times 'invoice' word appear in that table using query,

    Note: i am asking in varbinay datatype, not for nvarchar datatype.

    • This topic was modified 1 month, 3 weeks ago by  Aravind.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • As varbinary is quite an ambiguous form and PDFs can be in several various formats, you might want to help us helping you by posting an example, that is some source data and the expected results.



  • In my question i gave example already, pls read fully.

  • Aravind wrote:

    In my question i gave example already, pls read fully.

    You have not provided source data. Please read Eirikur's post fully.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • What is meant by source data ? are you asking sample pdf file ? its confident i cant provide in public , as i told i gave contains query for full text index table, you can use any ocr'd pdf for testing. This is the query for filter in full text indexed table.

    SELECT * FROM FileStore WHERE CONTAINS(Document,'invoice')

    Excepted result as count result.

    E,g : if one of file got 'invoice' word appear 10 times in that pdf, so result i want 10.

    You know count function in sql what it return ? if u use this query u get row count as result

    Select count(*) from tablename

    Same like i need to count no of occurrences 'invoice' word form the table which in varbinary(max) datatype

    • This reply was modified 1 month, 3 weeks ago by  Aravind.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply