September 29, 2011 at 9:56 pm
how to retrieve a single document file (stored as BLOB) and save it into disk by using BCP command.
I've tried bcp "query" queryout "filepath&name" ...
But still not able to work. No error msg prompt, but no file save into the path I've specified.
Please help! Thanks.
September 30, 2011 at 8:01 am
Difficult to say without seeing real query used
September 30, 2011 at 8:10 am
SSC poster Elliot Whitlow has this CLR project for file manipulation , and includes Blob read write stuff as well;
it took me about three minutes to install, and has worked very well for me so far;
http://nclsqlclrfile.codeplex.com/
it's a lot easier to use than bcp.
I have an example of importing a blob from disk to table, but not from db to disk; i've always done it in a programming language instead.
Lowell
October 2, 2011 at 7:54 pm
Thanks, I'll try.
October 3, 2011 at 5:51 am
Tan Hui Siang (10/2/2011)
Thanks, I'll try.
Elliot's Project makes the image insertion really simple;
here's a code example...once you have the CLR in place, it is soooo simple:
CREATE TABLE myImages(id int,filename varchar(200),rawimage varbinary(max) )
INSERT INTO myImages(id,filename,rawimage)
SELECT 1,'fedora_spinner.gif',dbo.MFGetFileImage('C:\Data\','fedora_spinner.gif' )
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply