February 6, 2008 at 9:32 am
We have some documents stored in our database as an image data type. How can we get a file OUT of SQL and save it in the file system? I have found plenty of information on getting this type of data into SQL, but nothing that shows how to get it back into the file system.
February 6, 2008 at 9:38 am
February 6, 2008 at 9:52 am
thanks for the reply, but I was hoping for some native SQL commands. Since you can load an image into the database using native SQL commands, I figured you could get them back out using similar commands.
This is how we inser them using native SQL. Any ideas on a reversal here?
INSERT INTO [Enterprise].[dbo].[FHLBLoanOfficerSignatures]
([NetworkID]
,[SignatureImage])
VALUES ('ShinnB', 'd')
UPDATE [Enterprise].[dbo].[FHLBLoanOfficerSignatures]
SET [SignatureImage] = (SELECT *
FROM OPENROWSET(BULK 'C:\test.jpg',
SINGLE_BLOB) AS a )
WHERE [NetworkID] = 'NetID1'
February 6, 2008 at 10:09 am
I am unaware of any method in T-SQL to retrieve binary data (BLOB). To the best of my knowledge this can only be achieved with ADO, VB.NET, etc.
Tommy
Follow @sqlscribeViewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply