i've got a problem and feel a little out of ideas:i'va a website where i upload attachments via html input tag (wihout any conversion) into an uploadfile-object on apache myfaces. Using .getBytes i get an java bytearray which will get sent into an oracle 11g database in an BLOB column. Works perfectly fine if it stays like this.

now i got an sql server 2008 database where i'd like to query the data including my blob-column:

works perfectly fine for PDF files. but when i do the same with XLS or XLSX files, it creates the files properly, but when i try to open it, it fails with type problems....

i realized when i compared the files, that in the BCP file there is an 4-byte prefix at the beginning of the file. the rest seams the same. interesting to see, that even in the PDF file, there are 4 heading prefix-bytes. the pdf editor doesnt care...anyhow.

i also tried to create a format file and used it instead of the -n option. the file looked likes this: