Question

I've got a script running in a Foreach Loop Container, inside my package's Control Flow.

In the script, I am throwing a warning, then exiting with success

Dts.Events.FireWarning(-1, "", "warning message here", "", 0);

Dts.TaskResult = (int)ScriptResults.Success;

I've set the system Propagate variables all to false.

Also tried setting the Package property DisableEventHandlers to True.

Variables

However, duplicate warning messages are still being thrown in the order of:

  1. Script
  2. Foreach Loop Container
  3. Package

I could possibly log each incident as Information instead of a Warning... but I dont want to log all Information. Logging all Warnings is much more realistic.

Was it helpful?

Solution

Create an OnWarning Event Handler for your script task. The event handler does not need any tasks of its own, but it does need its system variable Propagate set to False.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top