BULK INSERT with Excel from a VARBINARY(MAX) field

BULK INSERT Communication.Message

FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

'Excel 8.0;Database=C:\temp\Messages201101.XLS', [messages$])

How do I take the above and instead read Message.XLS from a Varbinary(max) field named FileBytes in a table named Attachments.FileContents? I already know how to stage it in the table by various methods-- I just do not know method to use a BULK INSERT from a VarBinary(max) field.

Answers


The Jet driver can't open a VARBINARY that contains the bytes of your file. Looking at this MSDN page, the documentation doesn't talk about opening/mounting anything except files. You would have to take the bytes out of FileBytes, write them to a file and then use that file in your OPENROWSET statement.


Need Your Help

Why is PassportJS in Node not removing session on logout

javascript node.js express logout passport.js

I am having trouble getting my system to log out with PassportJS. It seems the logout route is being called, but its not removing the session. I want it to return 401, if the user is not logged in in

Spring 4.0 WebSocket with Spring Security 3.2.3 in Grails

spring grails spring-security spring-websocket

I need to add realtime updates to a system. I'm using Grails 2.5.0 with Grails Spring Security Core 2.0 RC4, which is based on Spring Security 3.2.3. There's a Grails plugin to add Spring 4.0 WebSo...