Monday, March 16, 2009

Event , Event Handler and Auditing in SSIS

I'm reading: Event , Event Handler and Auditing in SSISTweet this !
The Integration Services runtime includes the IDTSComponentEvents interface (Events collection) that is passed by the runtime to various components that execute within a package, such as tasks, enumerators, and so on. Events are raised by tasks using the IDTSComponentEvents interface that is supplied during execution and by the run-time execution engine. In the Script task, the Events property on the Dts object is really an instance of the IDTSComponentEvents interface.

Components raise events by using the Fire[x] methods. Components can also raise events at any point during execution. Events allow component developers to provide feedback to users of the component as it executes. Calling the FireError method during execution is likely to fail the package.

The Fire methods can be called at design time and during execution. Typically, during component design, the FireError, FireInformation, and FireWarning methods are called to provide user feedback when a component is incorrectly configured. Events that are raised during component design are displayed in the Task Pane.

In SSIS, any events you fire will be written to all enabled log handlers that are set to log that event. Logging allows you to see what happened with your script when you’re not there to watch it run. This is useful for troubleshooting and auditing purposes. The default event handler at design time is the Execution Results tab in the BIDS design environment. This is particularly useful in Script Tasks, if the script task is performing complex operations and an info or warning is required to be logged for each such entry in the data stream.

Within a Script Task, the Log method of the Dts object writes a message to all enabled log providers. The Log method is similar to the FireInformation method of the Events property, but it is easier to use and more efficient — you also do not need to create a specialized event handler to respond to the method call. All you need to do is set up a log provider within the package.

Reference: MSDN BOL

No comments:

Related Posts with Thumbnails