OK ... I have a relatively simple SSIS package (DTSDesigner100, Visual Studio 2008 Version 9.0.30729.4462 QFE, .NET Framework 3.5 SP1). At the end of the SSIS control flow for the package is the File System Task , which is the Rename File operation .
The properties of this file system task are as follows:
- IsDetinationPathVariable: True
- DestinationVariable: User :: OutputFileName
- OverwriteDestination: True
- Description: File System Task
- Operation: rename file
- IsSourcePathVariable: False
- SourceConnection: Assign Copy of Excel Template
There are no specific expressions. As you can see, I have an assignment assigned as a variable User :: OutputFileName. So let's look at this variable ...
- Name: OutputFileName
- Scope: Package
- Data Type (ValueType): String
- Value:
- Namespace: User
- EvaluateAsExpression: True
- ReadOnly: False
- Expression: (see below)
.
"\\\\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"
So, I can successfully evaluate this expression. Each time a package starts (and fails), its value is the value of the evaluated expression, as you would expect.
When I run the package, this is what happens ...
- The previous steps are successful.
- The file system starts and the file is renamed successfully.
- However, the package now fails because the file system problem failed:
.
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, , - .
, , ? .