I have a varbinary(max) column that I need to bulk import. The data I'm putting into this column is a byte[] in C#. How do I format the data in the comma-delimited file used for bulk import? In other words, how do I convert from a byte[] to a string in a way the bcp utility will accept?
Sql-server – How to import a varbinary(max) column with bulk import
bcpcsql server
Related Question
- SQL Server – Importing Different File Types with SSIS
- Sql-server – How tonsert all PDF files from a folder into a varbinary(max) column in SQL using a Query
- SQL Server – Creating Format Files to Import TXT File
- Sql-server – Sql server bulk insert remove text qualifier
- Sql-server – OPENROWSET Bulk insert Text File NULL Columns
Best Answer
A varbinary value is of the form
0x01020304
for SQL Server to read.So your CSV would be
Edit May 2013,
After testing, I can't get this to work with BULK INSERT with or without a format file.
I will post something more when I get it working. I can't delete this answer