Re: Retrieve large binary object via freebcp
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4fsP3f6OLJ3v_GHvCD2mq0npD8ZLEZzs8xUVm67t7dHHQ@mail.gmail.com> |
Il 05/feb/2014 15:37 <[email protected]> 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