BULK INSERT with Excel from the VARBINARY field (MAX)

BULK INSERT Communication.Message FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\temp\Messages201101.XLS', [messages$]) 

How to take the above and instead read Message.XLS from the Varbinary (max) field named FileBytes in a table named Attachments.FileContents? I already know how to put it in a table in various ways. I just don't know how to use BULK INSERT from the VarBinary (max) field.

+4
source share
1 answer

The Jet driver cannot open VARBINARY , which contains the bytes of your file. Looking at this MSDN page , the documentation does not say about opening / installing anything other than files. You will need to output bytes from FileBytes , write them to a file, and then use this file in the OPENROWSET .

0
source

All Articles