2011-12-28 58 views
1

我正在使用下面的查询在变量的sql命令中从两个不同的表中获取数据。外部列“y.col1”(598)需要从外部列中移除

SELECT x.*, y.col1, y.col2 
FROM table1 AS x 
INNER JOIN table2 AS y ON y.AccID = x.accID 

按我的业务逻辑,我需要使用查询从变量SQL命令。 当我运行设置DelayValidation封装后的,我得到了以下错误:

"[OLE source **table1**]] Warning: The external columns for component 
"OLE source" (1) are out of synchronization with the data source columns. 
The external column "**col2**" (601) needs to be removed from the external columns. 
The external column "**Col1**" (598) needs to be removed from the external columns.".. 

[SSIS.Pipeline] Error: "component "OLE source **table1** " (1)" failed validation 
and returned validation status "VS_NEEDSNEWMETADATA". 

回答

2

在你的SQL的变化影响您的OLE源组件的设置。您需要重新访问SQL输出的列分配。此外,你将不得不检查你的目标SSIS组件,看看是否有任何改变也会影响它。每次更改SQL时,都需要仔细检查sql-column-to-component-column分配。

Warning: The external columns for component "OLE source" (1) are out of synchronization with the data source columns.意味着您的组件发生了变化。将DelayValidation设置为TRUE仅仅意味着在设计时不会发生组件验证。

The external column "**col2**" (601) needs to be removed from the external columns. The external column "**Col1**" (598) needs to be removed from the external columns."..将帮助您指出您的作业可能出错的方向。看起来你可能会减少你的列或者在包执行之前的某个时间添加它们。这就是组件验证严格的地方 - 你也可能只是改变了你的SQL命令的情况(在这种情况下可能是列名),并且只能触发"VS_NEEDSNEWMETADATA"

再一次,重新检查组件的列分配,并且如果更改源组件的列设置中的任何部件,它也会影响目标(以及其间的其他数据转换)。

+1

你提到检查的东西,但我该如何让错误消失?似乎每次都没有按钮可以帮助我解决问题。 – 2016-09-08 13:01:21