Sql ошибка 0xc02020a1

Consider the following scenario:

  • You create a SQL Server 2005 Integration Services (SSIS) package in Business Intelligence Development Studio (BIDS).

  • You use a Flat File source to read data from a text file in a data flow task.

  • You use a multi-character column delimiter in the Flat File source. For example, the multi-character column delimiter is a character string of three tilde characters (~~~).

  • The text file contains a large amount of data. For example, the text file contains more than 20,000 records.

  • You run the SSIS package.

In this scenario, the SSIS package may fail. Additionally, you receive the following error messages:

Error: 0xC02020A1 at Data Flow Task, Flat File Source [1]: Data conversion failed. The data conversion for column «<column_name>» returned status value 4 and status text «Text was truncated or one or more characters had no match in the target code page.».

Error: 0xC020902A at Data Flow Task, Flat File Source [1]: The «output column «<column_name>» (199)» failed because truncation occurred, and the truncation row disposition on «output column «<column_name>» (199)» specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

Error: 0xC0202092 at Data Flow Task, Flat File Source [1]: An error occurred while processing file «<path_of_the_flat_file>» on data row <row_number>.

Error: 0xC0047038 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component «Flat File Source» (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.

Symptoms

This issue occurs because the input buffers for the flat file parser incorrectly divide the multi-character delimiter into two parts.

Cause

Service pack information

To resolve this issue, obtain the latest service pack for SQL Server 2005.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

913089 How to obtain the latest service pack for SQL Server 2005

Resolution

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

Status

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

I have a a table which has a column:

material_desc nvarchar(255)

I am loading data using SSMS import from a csv file. While laolding a line:

Concentrate of Poppy Straw (Material Specification Name)

I get error:

Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column «Column 1» returned status value 4 and status text «Text was truncated or one or more characters had no match in the target code page.».

I though this error was because 255 size  in nvarchar is 255, so I increased it to 1024, but I still got this error. I do not think error is because size of my column is small; it has to do something else.  I changes Specification Name to Sprec
Name, then row was loaded.

I come from Oracle background. I fail to understand reasons for trunction; is there some option to be set, but import wizard does not provide any options.  Will appreciate your help.

Импорт csv файла в sql

 

Ошибка 0xc02020a1: Задача потока данных 1: Ошибка преобразования данных. При преобразовании данных для столбца «Столбец 1» возращено значение состояния 4 и текст состояния «Текст был усечен, или один и более символов не имеют соответствия в целевой кодовой странице.».
 (Мастер импорта и экспорта SQL Server)




Ошибка 0xc020902a: Задача потока данных 1: Сбой Источник — vk_wall_for_sentiment_txt.Выводы[Выход источника «Неструктурированный файл»].Столбцы[Столбец 1] из-за возникшего усечения, и стратегия обработки усечения строк в «Источник — vk_wall_for_sentiment_txt.Выводы[Выход источника «Неструктурированный файл»].Столбцы[Столбец 1]» определяет сбой по причине усечения. Ошибка усечения возникла в указанном объекте указанного компонента.
 (Мастер импорта и экспорта SQL Server)

Ошибка 0xc0202092: Задача потока данных 1: Ошибка при обработке строки 2466501758478712832 в файле «C:UsersgordaDesktopvk_wall_for_sentiment.txt».
 (Мастер импорта и экспорта SQL Server)

Ошибка 0xc0047038: Задача потока данных 1: Код ошибки служб SSIS: DTS_E_PRIMEOUTPUTFAILED. Метод PrimeOutput для компонента Источник — vk_wall_for_sentiment_txt завершился сбоем с кодом ошибки 0xC0202092. Компонент вернул код ошибки при вызове метода PrimeOutput() из обработчика конвейера. Значение кода ошибки определяется компонентом, но ошибка является неустранимой, и выполнение конвейера остановлено. Возможно, до этого были опубликованы сообщения об ошибках, в которых содержатся более подробные сведения о причине сбоя.

 (Мастер импорта и экспорта SQL Server)

Решение проблемы: во вкладке «Дополнительно» мастера экспорта изменить тип проблемного поля на TextStream [DT_TEXT].

I’m trying to import a text file in my mssql database via SSMS import utility and it’s throwing below error:

    Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data 
conversion for column "Notes" returned status value 4 and status text 
"Text was truncated or one or more characters had no match in the target 
code page.". 

Suggested solutions available on internet, I have changed the code page to 65001(UTF-8). However, after updating that,I’m getting this new error:

    Error 0xc02020f4: Data Flow Task 1: The column "LastName" cannot be 
processed because more than one code page (65001 and 1252) are specified 
for it.
 (SQL Server Import and Export Wizard)

Also, ‘Edit Mappings’ section isn’t allowing me to increase column size as well.

enter image description here
any help will be appreciated in order to import my file

Here is the sample data which I want to import:
EmployeeID,LastName,FirstName,BirthDate,Photo,Notes
1,Davolio,Nancy,1968-12-08,EmpID1.pic,Education includes a BA in psychology
from Colorado State University. She also completed (The Art of the Cold
Call). Nancy is a member of ‘Toastmasters International’.

  • Remove From My Forums
  • Вопрос

  • Hi,

    I am new to SSIS.I am using Sql server 2008.

    For last few days it was worked fine without any issues.Since 2 days its getting failed.The error messages are below:

       Code: 0xC02020A1
       Source: DFT Create Output file FF_DST NPS File [109]
       Description: Data conversion failed. The data conversion for column «Segment
    J» returned status value 4 and status text «Text was truncated or one or more c
    haracters had no match in the target code page.».
    End Error
    Error: 2011-09-14 20:35:41.83
       Code: 0xC02020A0
       Source: DFT Create Output file FF_DST NPS File [109]
       Description: Cannot copy or convert flat file data for column «SegmentJ».
    End Error
    Error: 2011-09-14 20:35:41.84
       Code: 0xC0047022
       Source: DFT Create Output file SSIS.Pipeline
       Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput met
    hod on component «FF_DST NPS File» (109) failed with error code 0xC02020A0 whil
    e processing input «Flat File Destination Input» (110). The identified componen
    t returned an error from the ProcessInput method. The error is specific to the
    component, but the error is fatal and will cause the Data Flow task to stop run
    ning.  There may be error messages posted before this with more information abo
    ut the failure.
    End Error
    Error: 2011-09-14 20:35:42.36
       Code: 0xC02020C4
       Source: DFT Create Output file OLE_SRC NPS Transform [1]
       Description: The attempt to add a row to the Data Flow task buffer failed wi
    th error code 0xC0047020.
    End Error
    Error: 2011-09-14 20:35:42.36
       Code: 0xC0047038
       Source: DFT Create Output file SSIS.Pipeline
       Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput metho
    d on component «OLE_SRC NPS Transform» (1) returned error code 0xC02020C4.  The
     component returned a failure code when the pipeline engine called PrimeOutput(
    ). The meaning of the failure code is defined by the component, but the error i
    s fatal and the pipeline stopped executing.  There may be error messages posted
     before this with more information about the failure.
    End Error
    Progress: 2011-09-14 20:35:42.36
       Source: DFT Create Output file
       Post Execute: 0% complete
    End Progress
    Progress: 2011-09-14 20:35:42.36

       Source: DFT Create Output file
       Post Execute: 33% complete
    End Progress
    Progress: 2011-09-14 20:35:42.41
       Source: DFT Create Output file
       Post Execute: 66% complete
    End Progress
    Progress: 2011-09-14 20:35:42.41
       Source: DFT Create Output file
       Post Execute: 100% complete
    End Progress
    Progress: 2011-09-14 20:35:42.41
       Source: DFT Create Output file
       Cleanup: 0% complete
    End Progress
    Progress: 2011-09-14 20:35:42.41
       Source: DFT Create Output file
       Cleanup: 33% complete
    End Progress
    Progress: 2011-09-14 20:35:42.41
       Source: DFT Create Output file
       Cleanup: 66% complete
    End Progress
    Progress: 2011-09-14 20:35:42.41
       Source: DFT Create Output file
       Cleanup: 100% complete
    End Progress
    Warning: 2011-09-14 20:35:42.41
       Code: 0x80019002
       Source: NPS_Export
       Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Executio
    n method succeeded, but the number of errors raised (5) reached the maximum all
    owed (1); resulting in failure. This occurs when the number of errors reaches t
    he number specified in MaximumErrorCount. Change the MaximumErrorCount or fix t
    he errors.
    End Warning

    Please any one suggest me how to resolve this issue.

    Thanks in advance..

    Regards,

    Santosh Y


    Santosh Y

I exported data from one SQL Server table into csv file and now I wanted to import this file into second table in another database.
A the begin I choosed coding as Unicode:
code page of source

I tried as ANSI — Latin 1 but the error was the same. I think that with truncating is everything ok, because table is the like in source table:
enter image description here

Source table page coding is:

CREATE DATABASE [source-database]  (EDITION = 'Standard', SERVICE_OBJECTIVE = 'S3', MAXSIZE = 200 GB) WITH CATALOG_COLLATION = SQL_Latin1_General_CP1_CI_AS;
GO

I cannot import data because I get error:

Executing (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "JobName" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
 (SQL Server Import and Export Wizard)
 
Error 0xc020902a: Data Flow Task 1: The "Source - Job1_csv.Outputs[Flat File Source Output].Columns[JobName]" failed because truncation occurred, and the truncation row disposition on "Source - Job1_csv.Outputs[Flat File Source Output].Columns[JobName]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
 (SQL Server Import and Export Wizard)
 
Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "C:tasksxxxxxJob1.csv" on data row 5.
 (SQL Server Import and Export Wizard)
 
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - Job1_csv returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)

Only JobName column is wrong.

Hello guys,

The import from Flat File Source fails:

Error 0xc02020a1: Data Flow Task 1: Data conversion failed.

The data conversion for column «ArticleName» returned status value 4 and status text «Text was truncated or one or more characters had no match in the target code page.».

(SQL Server Import and Export Wizard)

I have changed the size of the column «ArticleName» (varchar) to max but the error comes up again.

The data i want to import came with multiple flat files. They all could import properly but this one is a problem.

Has someone a idea what i can try more?

Lowell

SSC Guru

Points: 323498

i just had somethign similar, where the column value was the result of a convert(varchar,columnname) function.

I had to right click on the data source and select «Show Advanced Editor.

Then the tab that was labeled «Input and Output Properties»

in my case, when i expanded the tree node that says «Ole DB Source Output»>>External Columns>>Specific column name, the Length was 1, instead of 30 that i expected.

once i changed it there, my package ran as expected. possible, if i converted with a specific size, that might allow SSIS to determine the 30 char length instead of my lazy assumption on thirdy chars.

Lowell


help us help you! If you post a question, make sure you include a CREATE TABLE… statement and INSERT INTO… statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Я безуспешно пытаюсь импортировать CSV-файл в базу данных SQL-сервера. Я все еще новичок в sql server.

Операция остановлена ​​…

  • Инициализация задачи потока данных (успех)

  • Инициализация подключений (успех)

  • Установка команды SQL (успех)

  • Настройка подключения к источнику (успех)

  • Установка целевого соединения (успех)

  • Проверка (успех) Сообщения

    • Предупреждение 0x80049304. Задача потока данных 1. Предупреждение. Не удалось открыть глобальную общую память для связи с библиотекой производительности; счетчики производительности потока данных недоступны. Чтобы решить эту проблему, запустите этот пакет от имени администратора или на системной консоли. (Мастер импорта и экспорта SQL Server)
  • Подготовьтесь к выполнению (успех)

  • Pre-execute (Успех) Сообщения

    • Информация 0x402090dc: Задача потока данных 1: Начата обработка файла «D:test.csv». (Мастер импорта и экспорта SQL Server)
  • Выполнение (ошибка) Сообщения

    • Ошибка 0xc002f210: Удаление таблиц SQL Задача 1: Выполнение запроса «удалить таблицу [dbo].[test] » сбой со следующей ошибкой: «Невозможно удалить таблицу ‘dbo.test’, так как она не существует или у вас нет разрешения.». Возможные причины сбоя: проблемы с запросом, свойство «ResultSet» задано неправильно, параметры установлен неправильно или соединение установлено неправильно. (Мастер импорта и экспорта SQL Server)

    • Ошибка 0xc02020a1: поток данных, задача 1: преобразование данных не удалось. Преобразование данных для столбца «Код» вернуло значение состояния 4 и текст состояния «Текст был усечен или один или несколько символов не соответствовали целевой кодовой странице». (Мастер импорта и экспорта SQL Server)

    • Ошибка 0xc020902a: Задача потока данных 1: «выходной столбец «Код»» (38)» не удалось выполнить, поскольку произошло усечение, и расположение строки усечения в «выходном столбце «Код»» (38)» указывает сбой при усечении. Произошла ошибка усечения для указанного объекта указанного компонента. (Мастер импорта и экспорта SQL Server)

    • Ошибка 0xc0202092: поток данных, задача 1: произошла ошибка при обработке файла «D:test.csv» в строке данных 21. (Мастер импорта и экспорта SQL Server)

    • Ошибка 0xc0047038: задача потока данных 1: код ошибки SSIS DTS_E_PRIMEOUTPUTFAILED. Метод PrimeOutput для компонента «Источник — test_csv» (1) вернул код ошибки 0xC0202092. Компонент вернул код ошибки, когда обработчик конвейера вызвал PrimeOutput(). Значение кода ошибки определяется компонентом, но ошибка является фатальной, и выполнение конвейера остановлено. Перед этим могут быть опубликованы сообщения об ошибках с дополнительной информацией о сбое. (Мастер импорта и экспорта SQL Server)

  • Копирование в [dbo]. [Test] (остановлено)

  • Пост-выполнение (Успех) Сообщения

    • Информация 0x402090dd: поток данных, задача 1: обработка файла «D:test.csv» завершена. (Мастер импорта и экспорта SQL Server)

    • Информация 0x402090df: Задача потока данных 1: Начата финальная фиксация для вставки данных в «компонент «Назначение — тест» (70)». (Мастер импорта и экспорта SQL Server)

    • Информация 0x402090e0: Задача потока данных 1: завершена последняя фиксация для вставки данных в «компонент «Назначение — тест» (70)». (Мастер импорта и экспорта SQL Server)

    • Информация 0x4004300b: Data Flow Task 1: «component «Destination — test» (70)» записано 0 строк. (Мастер импорта и экспорта SQL Server)

6 ответов

Лучший ответ

У вас действительно есть две основные проблемы при импорте:

Ошибка 0xc002f210: Удаление таблиц. Задача SQL 1. Выполнение запроса «drop table [dbo]. [Test]» завершилось неудачно со следующей ошибкой: «Невозможно удалить таблицу dbo.test, потому что она не существует или вы нет разрешения. «.

Похоже, вы пытаетесь отбросить таблицу, которой даже не существует. Решение: просто не делайте этого!

Ошибка 0xc02020a1: задача потока данных 1: сбой преобразования данных. Преобразование данных для столбца «Код» возвратило значение состояния 4 и текст состояния «Текст был усечен или один или несколько символов не совпадали на целевой кодовой странице.».

Ваш столбец «Код», очевидно, длиннее, чем результирующий столбец, который у вас есть в целевой таблице. Проверьте сопоставления — возможно, это очень длинная символьная строка, а длина по умолчанию для столбца VARCHAR в SQL Server слишком мала. Измените тип данных целевого столбца, например, на VARCHAR(MAX) — это дает вам 2 ГБ места! Этого должно быть достаточно ….

Также кажется, что столбец «Код» содержит символы, которых нет в текущей выбранной кодовой странице в SQL Server — можете ли вы удалить эти дополнительные специальные символы перед импортом? В противном случае вам может потребоваться использовать NVARCHAR(MAX) для типа данных вашего целевого столбца, чтобы он мог использовать Unicode для своих символов (таким образом поддерживая даже самые экзотические символы во входной строке).


8

marc_s
26 Май 2010 в 09:22

«Текст был усечен, или один или несколько символов не соответствовали целевой кодовой странице».

Может произойти ДАЖЕ когда:

  • ваш исходный плоский файл — это файл UNICODE

А ТАКЖЕ

  • ваш целевой столбец определяется как nvarchar (max).

Мне потребовалось время, чтобы понять.

Причина

SSIS определяет типы данных в исходном файле, просматривая первые N строк и делая обоснованное предположение. Из-за бесконечно повторяющихся попыток заставить его работать, он припарковал метаданные для типа данных (OutputColumnWidth) где-то на 50 символов, что привело к усечению внутри пакета.

Разрешение

В таком случае, возиться с метаданными на вкладке «Дополнительно» источника данных — это то, что вы хотите сделать, чтобы решить проблему. Попробуйте сбросить все настройки, поигравшись с настройками в «Типах предложений», или измените настройки для каждого поля отдельно. В моем случае потребовалось поистине обескураживающее количество итераций (широкий входной файл), но в конечном итоге вы можете заставить его работать.


14

Eoan
18 Июн 2010 в 11:20

У меня такая же проблема:

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "target" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

Решением было перейти в «Дополнительно» и изменить ширину столбца на 255.


1

user977812
4 Окт 2011 в 09:01

Или вы также можете проверить размер текста, перейдя в расширенный режим, затем проверив предложение, а затем преобразовав строку в строку Unicode. это помогает в разрешении ошибок, связанных со строкой. В последнее время я много с ними сталкивался!


1

SonalKhodiyar
17 Фев 2012 в 21:44

Учитывая тот факт, что это очень быстро, рекомендуется использовать рекомендуемые типы и настраивать параметры для каждого поля отдельно. Если вы создаете итоговую таблицу напрямую, вы можете немного увеличить ширину столбцов для последующего ввода данных. Я предлагаю просто подсчитать количество строк в вашем импортируемом файле и просканировать весь набор как «образец». Меньшее может привести к ошибкам. Время на настройку, вероятно, не стоит вашего времени.


0

Michael
7 Июн 2011 в 00:17

Для «Ошибка 0xc02020a1» мой случай был решен путем изменения формата ячейки со стороны файла CSV: (Откройте файл CSV с помощью excel >> измените формат ячейки с процента на общий, затем сохраните его), что решило мой случай.


0

HassanSh__3571619
17 Июн 2014 в 18:45

Понравилась статья? Поделить с друзьями:
  • Sql access ошибка синтаксиса пропущен оператор
  • Sql 303 ошибка
  • Spyder python ошибка
  • Spv69t70ru ошибка e09
  • Spu orb произошли некритические ошибки