Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF Files

Status
Not open for further replies.

GRHE

Programmer
Jun 19, 2001
29
0
0
GB
Hi

I have been given a database which has a PDF file stored in an IMAGE column. How do you extract this into a usable .PDF file using SELECT ????????

Cheers

PS> I have searched through previous threads, but can't find one with the answer...
 
SQL denis, you would miss out on all the great features that SQL has to offer in backup and restore, security and performance (it caches frequent pdf's).

THere is (are) no real issue(s) with working with blobs in SQL. PERIOD!

I have a web app, that allows a user to upload a pdf (and for that matter any other good mime compliant file format), and will then allow them to retrieve the PDF into acrobat reader (or excel or word - depending on mime type) via another webpage. And it never places the files on the harddrive. All streams and bytearray driven.

VERY EASY!

Rob
 
Rob,

Is this something you can/will share? Is it purchased software? It sounds interesting.

Bob S.
 
By loading the files into the IMAGE data type you also get the ability to do full text searches against them so you can search documents without building a keyword table.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 

GRHE,

Thanks for recommending the article about TEXTCOPY.EXE.

Do you know where I can get more information about this utility? I followed the instruction in the article, but keep getting the message:

Text or image pointer and timestamp retrieval failed.

Can't find anything about this in BOL.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Sorry this is all I found and works like a dream for me -- :)
 

OK, I've got it sorted.

For the benefit of others who need to do this, GRHE recommended an article that suggested an undocumented command-line utility called TEXTCOPY.EXE. This copies data to and from Text and Image columns. This utility is in the SQL Server Binn directory.

When I first ran it, I kept getting an error message. It turns out that you can't copy data into a null Text or Image column. That's where I was going wrong.

So, I simply stored a binary zero (0x0) in the column first, then ran the utility, and it worked fine.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
BSMan..

If you want the code email me
(run the following script in QA)
Code:
Declare @i int
Declare @email varchar(300)
set @i=1
set @email = 'spcAmzodiufl/dpn'
while @i < len(@email)+1
begin
		set @email = stuff(@email,@i,1, char(ascii( substring(@email,@i,1)) - 1))
		set @i = @i + 1
end
--'declare @email varchar(300)
select @email
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top