从数据流列插入数据可能会出现SSIS Truncation

SSIS Truncation may occur due to inserting data from data flow column

我在 SSIS 中构建了 Foreach 循环容器,它从目录中的多个 excel (*.xlsm) 文件中提取数据,然后将结果写入另一个位置。

[最终 BCS 描述] 给我带来了问题。我尝试使用数据转换 DT_WSTR.

我遇到错误:

Truncation may occur due to inserting data from data flow column "Copy of Final BSC Description" with a length of 2000 to database column "Final BSC Description" with a length of 255.

这没有意义。源中的“最终 BSC 说明”大于 255,并且目标中没有上限。有人能提供解决方案或解决方法吗?

错误信息如下。

SSIS package  starting.
Information: 0x4004300A at Load Excel Files, SSIS.Pipeline: Validation phase is beginning.
Warning: 0x802092A7 at Load Excel Files, Excel Destination [12]: Truncation may occur due to inserting data from data flow column "Copy of Final BSC Description" with a length of 2000 to database column "Final BSC Description" with a length of 255.
Information: 0x4004300A at Load Excel Files, SSIS.Pipeline: Validation phase is beginning.
Warning: 0x802092A7 at Load Excel Files, Excel Destination [12]: Truncation may occur due to inserting data from data flow column "Copy of Final BSC Description" with a length of 2000 to database column "Final BSC Description" with a length of 255.
Warning: 0x80049304 at Load Excel Files, SSIS.Pipeline: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available.  To resolve, run this package as an administrator, or on the system's console.
Information: 0x40043006 at Load Excel Files, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Load Excel Files, SSIS.Pipeline: Pre-Execute phase is beginning.
Error: 0xC0202009 at Load Excel Files, Excel Destination [12]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80040E21  Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
Error: 0xC002F445 at Load Excel Files, Excel Destination [12]: An error occurred while setting up a binding for the "Control Design Rationale" column. The binding status was "DT_NTEXT".
Error: 0xC0202025 at Load Excel Files, Excel Destination [12]: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
Error: 0xC004701A at Load Excel Files, SSIS.Pipeline: Excel Destination failed the pre-execute phase and returned error code 0xC0202025.
Information: 0x4004300B at Load Excel Files, SSIS.Pipeline: "Excel Destination" wrote 0 rows.
Information: 0x40043009 at Load Excel Files, SSIS.Pipeline: Cleanup phase is beginning.
Task failed: Load Excel Files
Warning: 0x80019002 at Foreach Loop Container: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (4) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (4) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package  finished: Failure.

我不知道为什么会出现这种情况,但必须匹配字段的长度我主要使用派生列并设置表达式来更改字符串的长度

找到解决方法。从 Advanced Editor for Excel Source 将数据类型更改为 Unicode string [DT_WSTR] Length = 2000

在目标 excel 文件的“最终 BSC 说明”单元格中,添加长度大于 255 个字符的虚拟值。然后隐藏整行。

stackExchange 中的 post 中得到灵感,选项 2