klaas.decanniere
2014-02-05 15:32:36 UTC
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.
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.