• JK 80940 (3/31/2014)


    Hi Guys,

    I have a sql server 2005 table that stores a list of small pdf articles, there are over 1900 of them, I have a Title, Author and Location field which stores a link to the file, I can search for a keyword in the Title and Author field but want to be able to search the content of the pdf itself. Can I bulk insert the pdfs into the database and make that field searchable, or would that be too slow?

    Thanks for any suggestions you may have.

    You will have to actually open the pdf and read it. If you insert it into the database you would have a byte array and the contents would look something like

    0x255044462D312E340D0A25........

    That obviously might be searchable but highly unlikely to return the desired results. The other option would be to open each file one at a time and scan them for the text you are looking for. I think I would look to CLR for something like this as just using sql is really not the right tool for the task at hand.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/