2012-01-13 3334 views
2

我正在導入一個製表符分隔的文件並獲取此錯誤。在SSIS中導入一個帶有大於255個字符的字段的製表符分隔文件

Error: 0xC02020A1 at Task 3 - Data Load for Core Data, Flat File Source [14]: Data conversion failed. The data conversion for column "Column 85" 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 Task 3 - Data Load for Core Data, Flat File Source [14]: The "output column "Column 85" (448)" failed because truncation occurred, and the truncation row disposition on "output column "Column 85" (448)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component. Error: 0xC0202092 at Task 3 - Data Load for Core Data, Flat File Source [14]: An error occurred while processing file "C:\Metrics\report-quoteCoreData.csv" on data row 540. Error: 0xC0047038 at Task 3 - Data Load for Quote Core Data, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Flat File Source" (14) 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

當我設置截斷錯誤忽略其中一個領域似乎導入。

不幸的是,我得到

Column A (customer) Column B (Location) Column C (should be Y or N) 
Jimmy      New York    ssssss (instead of Y) 

在此行我有超出255個字符,並導致上述SSIS的錯誤較早的領域。如果我告訴它忽略該錯誤,那麼我會爲該行插入錯誤的數據。 「Ssss ....」是超過255個字符的字段。

這裏有什麼解決方案?

+0

我會很高興回答你的問題,但請花一點時間,並考慮您的所有其他** 7 ** [開放性的問題(http://stackoverflow.com/users/ 1113251/james-khan?tab = questions&sort = newest),並將它們標記爲已回答或提供反饋。 – billinkc 2012-01-13 14:54:44

+0

不知道如何做到這一點?有一個看,但無法工作ou如何審查或amrk他們回答。 – 2012-01-13 16:43:47

+0

對於[此處]列出的每個問題(http://stackoverflow.com/users/1113251/james-khan?tab=questions&sort=newest),請閱讀可用答案。如果它們是有用的答案,請單擊數字左側的向上人字形/箭頭。如果可用答案中的某些內容解決了您的問題,請單擊將該答覆標記爲答案的複選標記的輪廓。 [具體示例](http://stackoverflow.com/questions/8615048/trimmining-a-column-with-bad-data),來自gbn和dems的回覆很有幫助,值得讚賞。檢查gbn的答案,因爲它是第一個和詳細的。 – billinkc 2012-01-13 17:31:25

回答

6

在您的Flat File Connection Manager中,您將需要調整每個列的OutputColumnWidth屬性,該屬性不足以容納傳入值。在您的示例中,Column 85目前定義爲255個字符,因此將其調高至合理的值。目標是使該值足夠大以覆蓋傳入的數據,但不會太大以至於浪費存儲空間。

一旦你改變你的連接管理器,任何使用相同CM的數據流都會報告列定義已經改變,你需要進入它們,雙擊並讓新的元數據慢慢下降。

enter image description here

我所看到的情況下,元數據不會自動某些類型的轉換(UNION ALL我看着你)後刷新。作爲完整性檢查,雙擊緊鄰目的地的連接器(可能是OLE DB目標)。點擊元數據標籤,並確保Column 85是500或您分配的任何值。如果不是,那麼你得到工作你的方式備份鏈,找出它卡住的地方。最簡單的解決方案通常是刪除麻煩的轉換並重新添加它。

enter image description here

+1

即使所有輸入發生更改,聯盟也不會更新輸出元數據。最簡單的解決方案就是刪除聯合中的那一行並讀取它。 – cairnz 2012-01-13 18:41:55

+0

根據您要放置數據的位置(以及太大的字段的性質),您可能需要添加功能將其修剪爲表格的字段大小,或者如果太大或發送到例外表格更改最終生產表字段的大小。 – HLGEM 2012-01-13 19:38:31

相關問題