我有一個SQL Server 2005 SP2數據庫,其中有一個poc_resp_city
屬性的表nvarchar(35)
。SSIS字符串截斷錯誤
2個月前更改爲nvarchar(80)
,未對齊數據倉庫中的相同屬性。 (仍然具有nvarchar(35)
)
的SSIS數據加載包(後正常工作兩個月)現在每次還給封裝失效我下面的錯誤運行:
There was an error with output column "poc_resp_city" (2250) on output "OLE DB Source Output" (11). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.". There was an error with output column "poc_resp_city" (2250) on output "OLE DB Source Output" (11). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".
SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source Table" (1) returned error code 0xC020902A. 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.
無論是包裝還是數據庫已就此問題進行了修改。我知道我可以忽略這個錯誤,或者我可以做出安排以確保它的工作正常,但是我想提供一個正確和可接受的答案,說明修改後2個月出現此錯誤的原因。因爲也許我錯過了這種情況下的重要一步。
重要說明:我甚至沒有超過35個字符的單個記錄,所以截斷不會發生。 (這個警告屬於某種SSIS驗證步驟)
現在我想也許經過一段時間後,SSIS包會自行重新編譯,現在它會在元數據(35 =/= 80)中看到這種不對齊,並且因爲TruncationRowDisposition
屬性設置爲RD_FailComponent
,它會使組件失效。
而且我會排除代碼頁選項,因爲每個數據庫列都是nvarchar
而不是varchar
,所以這不應該是這種情況。
謝謝!
你在源表檢查MAX(LEN())?我想你會以某種方式選出一個超過35個字符的記錄,也許不會打印或尾隨空格。這似乎比自發重新編譯的解釋更可能,儘管SSIS 2005比較老,總是比2008或2012年更怪異。 – criticalfix
我檢查了它並檢查了LEN(城市+'a')也忽略了空格。 (因爲LEN('aa')和LEN('aa')返回相同的值,並且沒有超過35的記錄 – dn7123