伙计们。我正在为 SSIS 开发一个自定义组件。我在处理输入时遇到问题。问题是“ProcessInput”方法被多次执行。在这种情况下两次。
这是流程输入片段:
public override void ProcessInput(int inputID, PipelineBuffer buffer)
{
IDTSInput90 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);
if (input.InputColumnCollection.Count > 0)
{
while (buffer.NextRow())
{
try
{
for (int columnIndex = 0; columnIndex < input.InputColumnCollection.Count; columnIndex++)
{
ColumnInfo columnInfo = _columnInfos[input.InputColumnCollection[columnIndex].ID];
IDTSInputColumn90 inputColumn = input.InputColumnCollection[columnIndex];
try
{
//write to destination
}
catch (Exception writeEx)
{
throw new Exception("Couldn't write to destination");
}
}
}
catch (Exception ex)
{
throw ex;
}
}
}
else
{
throw new Exception("There is no columns in the input collection");
}
}
我不知道为什么它被调用了两次。这是数据流:
数据流 http://img371.imageshack.us/img371/3001/dataflowprocessinputrb6.png
这是映射窗口: 映射窗口 http://img78.imageshack.us/img78/3772/mappingprocessinputzs2.png