Retrieve large binary object via freebcp

[email protected]
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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) 

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 

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

Thank you very much for your help, 

Klaas 

Freetds is version 0.91 on Gentoo linux, the database is SQL Server 2008.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.