3

Is it even possible to import .csv flat file data into a SQL Server 2014 table using only the SSMS or SSIS Import/Export Wizards, if the table contains a varbinary(max) column?

I have searched hours and hours, and tried numerous configurations and different data types (e.g. DT_IMAGE) in both the SSMS and SSIS Import/Export Wizards to perform a simple, quick-n-dirty import of .csv file data into a four column table containing a varbinary(max) column in SQL Server.

I realize there are various other means to accomplish this by writing Trans SQL, using bulk-copy, adding column-import tasks, etc., but I find it hard to believe that I can't use the simple point-n-click configuration of the Import/Export Wizard, simply because the data happens to contain a varbinary(max) field, so I assume I must be doing something wrong.

Below are screen shots from the SSMS Import/Export Wizard...I get the same error in both SSMS and SSIS:

SSMS Import/Export Wizard Columns

SSMS Import/Export Wizard Error Messages

5
  • U have to provide a sample of the data. Commented Apr 23, 2017 at 19:19
  • Hadi, thanks for responding. While the rest of the fields are relatively small, the "Model" field has over 4K chars. What is the best way to provide the sample? Commented Apr 23, 2017 at 21:28
  • Store a sample to cloud and provide a link Commented Apr 23, 2017 at 22:00
  • Here you go: Sample Data Commented Apr 23, 2017 at 23:22
  • Anybody care to enlighten on the down vote(s)? Commented Aug 12, 2017 at 19:24

1 Answer 1

4

You can use DT_TEXT An ANSI/MBCS character string with a maximum length of 2^31-1 (2,147,483,647) characters. Integration Service Data types. It Will be varbinary(max) in database.

enter image description here

I have used the sample data provide by you and imported it in the database. enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

I was prepared to respond that your answer didn't address my question because you stated: "It Will be varchar(max) in database" (Typo?), and my question was how to import the data into a table containing a varbinary(max) field. However, I decided to give it another shot, specifying DT_Text for the varbinary(max) field as you suggested, and changing the "Text Qualified" setting to True for all the input fields...All of which I would've sworn I had already tried. BUT, THIS time it worked! Strange, but in any case, Thank you very much! Edit Sorry not enough rep points for Upvote to display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.