好的..。我有一个相对简单的SSIS包(DTSDesigner100,Visual 2008版本9.0.30729.4462 QFE,.NET Framework3.5 SP1)。包的SSIS控制流的末尾是一个文件系统任务,它是一个重命名文件操作。
此文件系统任务的属性如下:
没有已定义的表达式。如您所见,我将目标分配为变量用户::OutputFileName。让我们看看这个变量..。
名称: OutputFileName
。
"\\\\SERVER\\Folder\\" + "MyAwesomeExcelWorkbook_"
+ (DT_WSTR,4)DATEPART("year", GETDATE())+ "-"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("mm", GETDATE()), 2) + "-"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("dd", GETDATE()), 2) + "-"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("hh", GETDATE()), 2) + "-"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("mi", GETDATE()), 2) + "-"
+ RIGHT("0" + (DT_WSTR,2)DATEPART("ss", GETDATE()), 2)
+ ".xlsx"所以我可以成功地评估这个表达式。每次包运行(并失败)时,它的值都是求值表达式的值,正如人们所预期的那样。
当我运行这个包裹时,会发生这样的事情.
前面的步骤运行successfully.
。
Error: 0xC001F009 at Package: The type of the value being assigned to variable "User::OutputFileName" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
Task failed: Rename Excel Workbook
Error: 0xC0019001 at Rename Excel Workbook: The wrapper was unable to set the value of the variable specified in the ExecutionValueVariable property.
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 "Package.dtsx" finished: Failure.显然有一些小细节我在这里忘记了。现在,我尝试将整个表达式转换为一个DT_WSTR,512 --这个表达式的计算结果很好,但是文件系统任务仍然会因为同样的错误而失败。
有人能指出我忽略的细节吗?提前谢谢。
发布于 2012-05-03 19:30:49
您可能需要检查SSIS包中的“额外”变量。包范围内的变量应该在任务中可用。打开变量窗口,单击“显示所有变量”窗口,查看是否有两个变量--在不同的作用域--名为OutputFileName。

由于变量是在SSIS中以名称标识的,因此在较低范围内的变量(例如包含文件系统任务的序列容器)将有效地拦截包作用域变量的变量标识(如果两个变量命名相同的话):

希望这有帮助,安迪
https://stackoverflow.com/questions/10437284
复制相似问题