Custom Event Handler

  • I'm using a script task in inside the OnVariableValueChanged event handler to catch and log variable changes. It works great, but I'm capturing every event

    Here's the code in the script task:

    public void Main()

    {

    bool FireAgain = true;

    Dts.Events.FireInformation(0,

    String.Empty,

    "Variable " + Dts.Variables["System::VariableName"].Value.ToString() + " = " + Dts.Variables["System::VariableValue"].Value.ToString(),

    String.Empty,

    0,

    ref FireAgain);

    Dts.TaskResult = (int)ScriptResults.Success;

    }

    Here's an example of what's being logged.

    OnPreExecute,KBULLEN-865,RPI_NT\kbullen,ST Record Variable Value,{ade9472f-fa2c-4168-8f81-9f8725f18c94},{8CC7A14F-5632-40A8-A993-BF482AF08870},9/11/2014 2:13:44 PM,9/11/2014 2:13:44 PM,0,0x,(null)

    OnPreValidate,KBULLEN-865,RPI_NT\kbullen,ST Record Variable Value,{ade9472f-fa2c-4168-8f81-9f8725f18c94},{8CC7A14F-5632-40A8-A993-BF482AF08870},9/11/2014 2:13:44 PM,9/11/2014 2:13:44 PM,0,0x,(null)

    OnPostValidate,KBULLEN-865,RPI_NT\kbullen,ST Record Variable Value,{ade9472f-fa2c-4168-8f81-9f8725f18c94},{8CC7A14F-5632-40A8-A993-BF482AF08870},9/11/2014 2:13:44 PM,9/11/2014 2:13:44 PM,0,0x,(null)

    OnInformation,KBULLEN-865,RPI_NT\kbullen,ST Record Variable Value,{ade9472f-fa2c-4168-8f81-9f8725f18c94},{8CC7A14F-5632-40A8-A993-BF482AF08870},9/11/2014 2:13:44 PM,9/11/2014 2:13:44 PM,0,0x,Variable _RunningMode = SQLAgentInitiated

    In this scenario, I only want to catch the OnInformation event.

    Any idea how I filter out all of the other events? I've already gone in to the logging options for the package and turned off Pre\Post Validate\Execute events. I'm not sure where else to check.

    Thanks,

    Kevin

  • sqlpadawan_1 (9/11/2014)


    Here's an example of what's being logged.

    Logged where?


    Alex Suprun

  • Everything is logged to a text file (using the SSIS log provider for Text files)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply