Skip to Content.
Sympa Menu

freetds - Re: [freetds] Retrieve large binary object via freebcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Retrieve large binary object via freebcp
  • Date: Tue, 25 Feb 2014 10:02:10 +0000

Il 05/feb/2014 15:37 <klaas.decanniere AT telenet.be> ha scritto:
>
>
> Hello,
>
> I'm trying to retrieve a large binary entry from a database with freebcp.
The database is on a remote windows server (sql server), the data should be
downloaded to a linux machine.
> The data is in fact a ZIP file and can be up to 4 Gb in size.
>
> The query in itself works both in sql server management studio and in
freebcp as the correct object is retrieved
>
> On windows and using bcp as a client, I can sort-of retrieve the "binary
blob" using the following format file:
> 11.0
> 1
> 1 SQLBINARY 8 0 "" 1 BinaryContent ""
>
> (the file as written is larger than the original (padding??) so that some
unzip utilities can't read it, but it can be made to work)
>

It's not clear what you want to achieve. Do you want a way to retrieve a
column of data containing a file from command line?

Bcp output contains some additional headers/footers.

> When I try this on linux with freebcp, I get complaints:
> bcp: Unrecognized datatype found in format file
>
> Looking around for an alternative datatype I tried SYBBINARY, but this
ends in
> Msg 20049, Level 4
> Data conversion resulted in overflow
>

Ptobably you want sybimage

> How can I get the zipfile out of the database intact and unconverted and
unchanged?
> (linuxODBC is also installed if that helps)
>

Surely you can write a program to do it
> Thank you very much for your help,
>
> Klaas
>
> Freetds is version 0.91 on Gentoo linux, the database is SQL Server 2008.
>
>
>
>
Frediano




Archive powered by MHonArc 2.6.24.

Top of Page