SQL Server: Data Import Unable Using Flat File Error 0xc02020a1: Data Flow Task 1: Data Conversion Failed

I am trying to load a CSV file (comma delimited) into a SQL Server 2012 table (vs 11.0.2100.60). I created a table with all columns equal nvarchar(MAX)

for testing purposes, since I just want to get the data in the database just for testing. Unfortunately I keep getting the following error:

Message Error 0xc02020a1: Data Flow Task 1: Data Conversion Failed. The data transformation for Column 2 returned status
value 4 and status text "Text was truncated or one or more characters did not match in the target code page." (SQL Server Import and Export Wizard)

Error 0xc020902a: data flow Task 1: "Source - Book2_txt.Outputs [Output file with flat file]. Columns [Column 2]" failed because truncation occurred, and the location of the truncation string is on "Source - Book2_txt.Outputs [Output file with flat file]. Column [Column 2] "indicates truncation failure. Truncate error on the specified object of the specified component. (SQL Server Import and Export Wizard)

Error 0xc0202092: Data Stream Task 1: An error occurred while processing the file "C: \ Users \ shalinp \ Desktop \ MISO \ junk \ Book2.txt" in data line 3. (SQL Server Import and Export Wizard)

Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method for Source - Book2_txt returns error code 0xC0202092. The component returned a failure code when the pipeline engine was called PrimeOutput (). The meaning of the failure code is determined by the component, but the error is fatal and the pipeline has stopped executing. There may be a bug in messages posted before, with more information about the bug. (SQL Server Import and Export Wizard)

My file is large, but I created a new file that only contains the first 4 lines of data to test. Unfortunately stackoverflow does not allow uploading the file, so I cannot provide it (correct me if I am wrong?).

But here's a cut and paste of it:

1/1/2010,ARNLD HAZELTON BASE,HAZLTON HAZLTARNOL34_1 1 (LN/ALTW/ALTW),ACTUAL,1,($23.18)
1/1/2010,MANISTIQ_T1_T1_XF,MANISTIQ T1 T1 (XF/WEC/*),,1,($12.47)
1/1/2010,ONT-NYIS BASE,BECK2 BECK2GPACKAR_1 A (LN/ONT/NYISO); BECK2 BECK_BNIAG_3_1 A (LN/ONT/NYISO); BECK2 BECK_ANIAG_3_1 A (LN/ONT/NYISO); STLAWRE1 SAUND_MOSES1_1 A (LN/ONT/NYISO); BECK2 BECK2GNIAG_3_1 A (LN/ONT/NYISO); STLAWRE1 SAUND_MOSES__1 A (LN/ONT/NYISO),ACTUAL,1,($6.05)
1/1/2010,PADDCK_TWNLINE FLO PADDCK_BLACKHWK,TOWNELIN TLR_PAD 1 (LN/ALTE/ALTE),PADDOCK-BLACKHAWK 138 (X-53),1,($3.06)

      

I suspect the error occurs on line 3, column 3, which has a long text string:

BECK2 BECK2GPACKAR_1 A (LN/ONT/NYISO); BECK2 BECK_BNIAG_3_1 A (LN/ONT/NYISO); BECK2 BECK_ANIAG_3_1 A (LN/ONT/NYISO); STLAWRE1 SAUND_MOSES1_1 A (LN/ONT/NYISO); BECK2 BECK2GNIAG_3_1 A (LN/ONT/NYISO); STLAWRE1 SAUND_MOSES__1 A (LN/ONT/NYISO)

      

This suggests that I am using type nvarchar(MAX)

. Anyway, I appreciate the help.

Thank.

+3


source to share





All Articles