October 14, 2008 at 3:58 am
Hello,
I am trying to extract BLOB images from a table and storing each one to a file. I have used the code below to extract the images okay, but when i try to open or preview the images, i get a message saying they are in the wrong format. Any ideas would be greatly appreciated...
SET @zSQL = 'bcp "SELECT zData FROM database.dbo.table WHERE lID ='+CAST(@lID AS VARCHAR(255))+'" queryout "C:\temp\'+@zFile+'" -T -N -SServer'
EXEC master..xp_cmdshell @zSQL
Thanks,
Andy
October 14, 2008 at 11:59 am
can you tell your query to save to a file instead of a grid/text and just select what you need? may wanna turn off the (rows affected) stuff
October 14, 2008 at 12:20 pm
Getting the data to a file is always a client side operation. Saving results to a file might work if you return the blog only. Might need to muck with the headers a bit.
October 25, 2008 at 7:37 pm
Heh... Ice Cream Scoop... :hehe:
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply