I have a little Problem with a binary Column in my Database. I have a table named docs with the columns doc_id(PK) and doc_image(image, null).

I want upload an Excel file in this table with an SQL Script. First of all I triedSELECT BulkColumnFROM OPENROWSET( BULK 'C:\test.xls',SINGLE_BLOB) as ExternalFileIt worked on my local machine, but the updater for our clients doesn't have the permission for bulk. Also the Excel file is on the local machine and the script works on a server.In a next step i tried to upload the binary from the bulk command directly with an INSERT statement. But it doesn't worked. The generated Excel Sheet contains only cryptic symbols like:®à0ïð``0ïÿÿðÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿßÿÿòP0@P`p€ °ÀÐàð 0@P`p€ °ÀÐàð 0@ïÿÿóÐ0€@ °ÀÐàð 0ïÿÿóP`p€ °Ààð€ @pP`p` °ÀÐàð 0@P€ïÿÿÿïÿÿõïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõ ðð@Pà@ `Pÿÿÿÿÿÿÿð € `À=ûçRüà°<ì–Ìàp0pð ° ðð° pÿÿÿÿÿÿÿð @ð` ð ð P0@ð0P P0 ŸK

The binary has about 44k characters. What is the problem? I tried different ways for the upload such as CONVERT, but nothing worked. Is the binary too big for the upload? Is there another way to upload this binary?

I apologize for my mistakes in the question. English isn't my first language.

Sry I don't unterstand the question.I will save the whole excel in the database as a binary.The table in the database is:CREATE TABLE doc( doc_id uniqueidentifier ROWGUIDCOL NOT NULL, dok_image image NULL)The excel file is a template without any data. There are only a title, some column headings, 2 datefields and a bit layout.

In our solution you can create a report. The program take the excel sheet, put some data in this excel and save it local on the pc.And the developer of this function had a special idea. Why we don't save the excel file as an image in the database.Now I have to change this report with some new information. Also I have to change this excel file for the new information. But the file is saved as an image on the server.Now I have the update the excel on every client of us and thats the problem. The only way for this is a sql skript, which replace the old excel file.

then why dont you use same datasource the earlier report used, change the source statement (or procedure) to add your new changes and make it save in image(or excel) format so that it overwrites current version? you can do this in reporting tools like SQL Reporting Services.

I can change the file in the "administration" tool, where the excelfile will replace. This function works with a streamwriter.But we have about 50 customer, which use our solution. Every customer has his own database, where I have to change the excel file. We created an "autoupdater" which can execute sql Scripts on the different servers/databases of our customers. My idea was to create an sql script, which replace every excelfile and put it on the "autoupdater".