When running an SSIS package on SQL Server 2014 (v12.0.5556), it appears to be skipping Script Tasks. The test package does the following:
- Defines a variable X and initializes it to 0
- Uses a Script Task to set the value of X to 1
- Branches based on the value of X
Since the Script Task sets X=1, it should always branch to the task named Value is 1. It works when running within VS 2015.
When deployed to SQL Server (local machine or server), it branches to Value is 0 as if the Script Task never ran. However, the SSIS Logs show that the task was run successfully.
Are there any settings in SQL server or in the package that would cause it to skip Script Tasks when deployed to SQL Server?
The User::X variable is set as a ReadWriteVariable. Here's the code in the Script Task:
public void Main()
{
Dts.Variables["User::X"].Value = 1;
Dts.TaskResult = (int)ScriptResults.Success;
}
Here's the result when run in Visual Studio (it branches to Value is 1):
Here's the result when run in SQL Server (it branches to Value is 0):