Your precedent constraint defaults to an AND
situation. The preceding task must return success and the expression must be true.
In binary scenarios like this, only one of those two tasks is ever going to happen. By adding the next level of constraint in - both tied to the message box step, the final step is waiting for the "Enable CLR on server" to be successful as well as "CLR Enabled on Server" to be successful and for the value
to be equal to 0.
Since only one of those situations will work out, you need to swing the PC to be OR situation
That results in the green dotted lines instead of solid
As an FYI, in your Script task, assuming this runs in an automated fashion (SQL Agent), since you're using a message box, it will fail. There's a System level variable, System::InteractiveMode
which is a boolean. It indicates whether you're running in an environment where you can interact with the desktop or not. If that evaluates to false and you attempt any GUI activity, the package will error out.
I find it helpful to add code like the following
public void Main()
{
// TODO: Add your code here
bool interactiveMode = (bool) this.Dts.Variables["System::InteractiveMode"].Value;
bool fireAgain = false;
string message = "This is some message I likely built out using other SSIS Variable values";
if (interactiveMode)
{
MessageBox.Show(message);
}
this.Dts.Events.FireInformation(0, "CLR Check", message, string.Empty, 0, ref fireAgain);
Dts.TaskResult = (int)ScriptResults.Success;
}
There I have a check against my interactive mode and only attempt to display something if I can. I also go ahead and fire an OnInformation event because that's automatically logged in the 2012+ Project Deployment Model, shows in both the GUI and the Output panel in Visual Studio/SSDT/BIDS and is easily recorded from DTEXEC.exe call by appending I to the reporting parameter i.e. /rep EI
Best Answer
Wrap all the changes in a transaction and then abort it.
How To Use Transactions in SQL Server Integration Services SSIS