8

I'm trying to import a csv file with two columns (sku, description) into SQL Server 2008 using the SQL Server management studio 2012 import/export wizard. Because the description column definitely has rows greater than 8000 characters, I go to the advanced tab when choosing the csv data source and click on the description column and click "Suggest Types". It then puts in 16718 for the OutPutColumnWidth property. Apparently there is a description in there somewhere that is THAT long.

The sql it generates is:

CREATE TABLE [dbo].[mag-prod-descriptions1] (
[sku] varchar(7),
[descrip] varchar(16718)
)

However, when I execute the import, I get the error "Could not connect source component. Error 0xc0204016: SSIS.Pipeline: The "Source - mag-prod-descriptions1_csv.Outputs[Flat File Source Output].Columns[Column 1]" has a length that is not valid. The length must be between 0 and 8000."

If I change the OutputColumnWidth property to 8000 then I get an error saying the column was truncated. I can't win.

How do I get the thing to allow me to import cells that are greater than 8000 characters?

2
  • I've run across something like that too, only in Oracle, and I recall having to change some setting to allow the larger field, and then doing the import. Another option would be to say that truncating is ok, but I don't recall how that is done either. Sep 19, 2013 at 16:25
  • I had tried changing the truncation error setting to ignore rather than fail but it still failed. :-( Sep 19, 2013 at 16:35

2 Answers 2

11

Ack. Finally got it. The answer was to use the Text Stream datatype for the large column on the source file.

0

I see import issues with column size errors, I'm thinking...could this be a Unicode issue? Try using nvarchar instead of varchar when creating your table.

Reference: Unicode Works Better With SSIS

1
  • 1
    The problem isn't the destination column size. It's that sql isn't allowing more than 8000 characters in a column in the source. I've figured it out though. The datatype for the source worked as a Text Stream. Sep 19, 2013 at 16:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.