Sql-server – SSIS Script Task appears to run, but actually doesn’t

sql serverssis

I have a script task that appears as running fine, but no matter what I put inside nothing ever get executed. I tried all sort of stuff: logging via the built in SSIS Logging mechanism, logging through additional variables and SQL Command task and I can never figure what's wrong. I tried to put breakpoint and it won't break during debugging.

This is VS 2015 with SQL 2016. This issue happens only when deployed on one of the SQL Server. I previously has no issue at all at that server. I deployed the same package on a different SQL box (same configuration) and it ran as expected.

EDIT: To better clarify the problem I started a new SSIS Package, it only 3 script tasks in it:

Test Task:

    public void Main()
    {
        // TODO: Add your code here

        Dts.TaskResult = (int)ScriptResults.Failure;
    }

Once the Test Task is completed, it is linked to a "Success Task" if the test is successful, a "Fail Task" if it fails.

simple test package

On VS, the test task fail as expected and goes to the fail task. However once deployed it stop working.

Package Execution on VS

Package Execution on SQL

Best Answer

There are 3 things you can check:

(1) The TargetServerVersion property

Check that you are selecting the appropriate TargetServerVersion property

GoTo Project Properties >> Configuration Properties >> TargetServerVersion

enter image description here

(2) ForceExecutionResult property Value

Click on Fail Task and press F4 to show the perperty Tab, check that ForceExecutionResult is set to False.

(3) Run in 32-bit mode

Try running the package in 32-bit mode:

GoTo Project properties >> Debugging >> Run64BitRuntime  = False

enter image description here