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?