SSIS OLE DB源中的不正确外部列长度

发布于 2025-02-05 15:58:51 字数 2736 浏览 2 评论 0原文

我正在将数据从数据库_1传输到数据库_2,我创建了一个表i目标db,就像源db中的db一样,但是当我将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.

这是源视图:

”在此处输入图像描述“

这是目标表:

​href =“ https://i.sstatic.net/datln.png” rel =“ nofollow noreferrer”>

这是高级编辑:

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

I am transferring data from database_1 to database_2, I created a table i the destination DB like the one in the source DB, but when I connect the OLE DB source to the table and open the Advanced editor I found that the External column length for a specific column is different, the length in the sql server is varchar (50) but in the SSIS in Advanced editor is DT_SRT (30). I tried to edit it but when I check again it turned into 30 again.

When I execute the package an error rise saying that truncatination occurred on the column and the execution stops.

[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.

this is the source view :

enter image description here

this is the destination table :

enter image description here

this is the data flow :

enter image description here

this is the advance editor :

enter image description here

EDIT:

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

the Derived Column only contains code page correction as the screenshot below.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笨笨の傻瓜 2025-02-12 15:58:51

这里有两种不同的事情。

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。单同步目标列元数据

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

如果您确保了两个DB“方案”(设计时DB和运行时DB)具有相同的字段元数据,这是重新同步的最简单方法OLEDB数据库目标组件是:

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

There are two different things going on here.

1. String truncation error from a Derived Column

[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.

Note that the truncation message is coming from your Derived Column not the destination column. The derived column's length is 10, not 30 (or 50). Increasing the size of your DBusinessTypeNameAR derived column to 30 (DT_STR,30,1252) or 50 (DT_STR,50,1252) should remove the error.

enter image description here

2. Out-of-sync destination column metadata

If your design-time database's column meta-data does not match the run-time database 's column meta-data (you said in the comments your target database connection string was set by an expression) this may explain the out-of-sync destination database column metadata.

If you've ensured that the two db 'scenarios' (design-time db and run-time db) have the same field meta-data, the simplest way to re-sync out-of-sync destination table column meta-data for OLEDB Database destination component is to:

  1. Inside the OLE DB Destination Editor, click the table drop-down list to expand the list of target tables.
  2. Select a different table in the drop-down list.
  3. Move to a different "tab" in the editor.
  4. Back on the Connection Manager tab, select the original table from the table drop-down, and make sure that all mappings are in place (Mappings tab)
  5. Click ok and Save changes.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文