in reply to Retrieve file BLOB from SQL Server 'Image' field type

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2: Retrieve file BLOB from SQL Server 'Image' field type
by monkey_boy (Priest) on Sep 24, 2015 at 13:25 UTC

    It seems very odd to me that you are retrieving several rows of data and printing (not appending) that to a single file handle.

    Ignore this, you *ARE* appending to the file, and anyway, from your SQL, I doubt you are returning more than one row of data.

Re^2: Retrieve file BLOB from SQL Server 'Image' field type
by porg (Novice) on Sep 24, 2015 at 15:07 UTC
    update on this - using MS SQL tool "bcp" i get the same results as this perl script... so it looks to be a DB-side encoding issue... perhaps...
Re^2: Retrieve file BLOB from SQL Server 'Image' field type
by porg (Novice) on Sep 24, 2015 at 14:33 UTC

    Thanks for the helpful reply- The original docx file is 33KB, but the dump i get from the field is 643KB! Do you think this could be related to packing?

    I don't have a hex editor at the moment (downloading as I type this), but from viewing the raw file in notepad++, the documents do not appear to be similar at all.... I'll get back to you when i can view this in a legit hex/bin editor

Re^2: Retrieve file BLOB from SQL Server 'Image' field type
by porg (Novice) on Sep 24, 2015 at 15:28 UTC
    I found the issue.