Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Storing a Microsoft Word or Excel document in a database table column with a varbinary(max) datatype

$
0
0

We need to store a Microsoft Word or Excel document in a database table column with a varbinary(max) datatype.

Here's the table DDL:

CREATE TABLE document_t(mydocument VARBINARY(MAX)null)

Here's the bcp command:

"G:\Program Files\Microsoft SQL Server\100\Tools\binn\bcp.exe " dbname.dbo.document_tin"test word document.docx"-Sservername-T

We've tried several variations of options but always get the following bcp error:

Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Unexpected EOF encountered in BCP data-file

How can we avoid this error and get the document into the database?

 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>