PDF storage in SQL

  • How do I load a PDF into SQL? What would be the INSERT query?

    Thanks...Nali

  • You shouldn't... you should store the file name only and let the external app get the file using the file name.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I agree with Jeff; there are a number of very practical reasons why this is not a good idea.

    Look at BOL and read up on Image and Varbinary data types. Then choose Jeff's way of doing it.

  • I think I understand your concerns and why you'd want to store pointers to PDF files instead of loading them to SQL. However, in my environment, it currently makes more sense to store in the DB, if its possible, and if it passes testing.

    So far it looks like simple INSERT statements will not work, and I'll have to rely on a DTS or VB scripting to load the PDFs.....

  • And then, what?  You will still have problems getting the images out of the DB to be displayed.  Perhaps this will change your mind... there are hundreds more like it...

    http://www.sqlteam.com/item.asp?ItemID=986

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • there are good reasons to go either way. You use an interest statement and a small app to load the stream makes the most sense.

  • Know of any URL's that'll get Nali started on that, Steve?  I thought I had a good one but can't find it, now...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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