【问题标题】:Incorrect External column length in SSIS OLE DB sourceSSIS OLE DB 源中的外部列长度不正确
【发布时间】:2022-06-11 10:45:17
【问题描述】:

我正在将数据从 database_1 传输到 database_2,我在目标数据库中创建了一个表,就像源数据库中的表一样,但是当我将 OLE DB 源连接到表并打开高级编辑器时,我发现外部列特定列的长度不同,sql server 中的长度是 varchar (50),但高级编辑器中的 SSIS 中的长度是 DT_SRT (30)。我试图编辑它,但当我再次检查时,它又变成了 30。

当我执行包时,会出现一个错误,指出列上发生了截断并且执行停止。

[Derived Column [2]] Error: The "Derived Column" failed because truncation occurred, and the 
truncation row disposition on "Derived Column.Outputs[Derived Column 
Output].Columns[DBusinessTypeNameAR]" specifies failure on truncation. A truncation error 
occurred on the specified object of the specified component.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on             
component "Derived Column" (2) failed with error code 0xC020902A while processing input 
"Derived Column Input" (3). The identified component 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 running.  There may be error messages posted before this with more 
information about the failure.

[OLE DB Source [79]] Error: The attempt to add a row to the Data Flow task buffer failed with 
error code 0xC0047020.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on OLE 
DB Source 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 is fatal and the pipeline stopped executing.  There may be error 
messages posted before this with more information about the failure.

这是源视图:

这是目标表:

这是数据流:

这是高级编辑器:

编辑:

Microsoft SQL Server Data Tools for Visual Studio 2017 
Version 15.9.15
VisualStudio.15.Release/15.9.15+28307.812
Microsoft .NET Framework
Version 4.7.03062
****************************
SQL Server Data Tools   15.1.61906.03120
Microsoft SQL Server Data Tools

SQL Server Integration Services   15.0.1301.433
Microsoft SQL Server Integration Services Designer
Version 15.0.1301.433

Derived Column 仅包含代码页更正,如下图所示。

【问题讨论】:

  • 您能否通过帮助 > 关于 Microsoft Visual Studio 提供有关您的开发环境的信息? VS 和 SQL Server Integration Services 版本的具体版本。
  • 您是否使用多个目标数据库环境?您的连接字符串值是否来自项目参数或表达式?
  • 您的错误文本显示有一个 Derived Column.Outputs[Derived Column Output].Columns[DBusinessTypeNameAR]。引用的派生列的表达式是什么?
  • 您的表定义说它的长度为 50。但是您在 SSIS 中将其设置为 30。您需要更正它 - 删除列并添加它
  • 您需要检查派生列,并尝试先将其删除。

标签: sql-server ssis data-warehouse


【解决方案1】:

这里发生了两种不同的事情。

1.派生列中的字符串截断错误

[Derived Column [2]] Error: The "Derived Column" failed because truncation occurred, and the 
truncation row disposition on "Derived Column.Outputs[Derived Column 
Output].Columns[DBusinessTypeNameAR]" specifies failure on truncation. A truncation error 
occurred on the specified object of the specified component.

请注意,截断消息来自您的派生列而不是目标列。派生列的长度是 10,而不是 30(或 50)。将 DBusinessTypeNameAR 派生列的大小增加到 30 (DT_STR,30,1252) 或 50 (DT_STR,50,1252) 应该可以消除错误。

2。目标列元数据不同步

如果您的设计时数据库的列元数据与运行时数据库的列元数据不匹配(您在 cmets 中说您的目标数据库连接字符串是由表达式设置的),这可以解释输出-目标数据库列元数据不同步。

如果您已确保两个数据库“场景”(设计时数据库和运行时数据库)具有相同的字段元数据,那么重新同步不同步目标表列元数据的最简单方法-OLEDB 数据库目标组件的数据是:

  1. 在 OLE DB 目标编辑器中,单击表下拉列表以展开目标表列表。
  2. 在下拉列表中选择其他表格。
  3. 在编辑器中移动到不同的“标签”。
  4. 返回“连接管理器”选项卡,从表下拉列表中选择原始表,并确保所有映射都到位(“映射”选项卡)
  5. 单击确定并保存更改。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多