converting .pdf and .doc files into binary

  • Hi All,

    can any body please tell me the way/querry to store pdf and doc file in database. I am using SQL2005.

  • I think that the post below should help.

    http://qa.sqlservercentral.com/Forums/Topic222383-9-1.aspx

  • create table #ORStable (doclen bigint, doc varbinary(max))

    insert into #ORStable

    select len(bulkcolumn), * from openrowset(bulk 'C:\TABLEINFO.TXT', SINGLE_BLOB)

    as r

    select * from #ORStable

    select CAST(doc as nvarchar(MAX)) from #ORStable

    or search for openrowset

  • don't forget the document name so you can restore it back from the image!

    create table #ORStable (docname varchar(255), doclen bigint, doc varbinary(max))

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 4 posts - 1 through 3 (of 3 total)

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