我有一个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