Getting document OUT of SQL

  • 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.

  • 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'

  • 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.

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

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