Alerts and Notifications in SSIS

An alert enables an operator or operators to receive notifications when a certain event occurs within SQL Server, such as a query error, SSIS package failure, or backup completion.There are three different methods of notifications, as follows:

  1. Database Mail
  2. Pager (for which support will be removed in the future, but is still supported for anyone stuck in 1994)
  3. Net send (still supported but this feature cannot be used for any OS after Windows XP Service Pack 2)2000px-crystal_clear_app_email-svg

Hmm, so there’s really only one method of notification which you should use: the Database Mail notification.

There are three ways in which you could use notifications with SSIS packages:

  1. The Send Mail Task, typically in an Event Handler (SMTP server will be required to set this up)
  2. The Notify Operator Task, which is similar to the Send Mail Task, but allows you to select the operators in SQL Server Agent to be notified
  3. The Execute SQL Task, using the sp_notify_operator command, is basically the same thing as the Notify Operator Task, but this method allows greater flexibility.

 

Advertisements

Logging options for SSIS

There are several logging options available for SSIS packages, and it can be difficult to know which is the best one to use. Let’s take a closer look at the different SSIS logging options, and what they can do.

SQL Server log provider saves log events into the sysssislog table in the msdb database by default, or in a database which you specify. The table can then be shared between users who can access the database.

Text files log provider stores the same information as the SQL Server log provider into a text file. This could easily be emailed to another user, or imported to a database or Excel spreadsheet later.

XML files log provider allows you to save the information as an XML file, which can add portability to the log data across different platforms, and also allow easy reading which viewed in an XML viewer or certain web browsers.

SQL Server Profiler, when used in SSIS, provides the same information as the other log providers, but saves the log events as a trace file so that it can then be correlated with Performance Monitor. This is a great way to monitor performance issues and pinpoint drags on performance. (See this great article by Brad McGehee for more info)

Windows Event Log log provider stores event information in Windows Event Viewer, which can then be used by system administrators. I feel this method is a little tedious when it comes to analysis, but some might find it useful.

For performance related diagnostics, I would store the log events in a trace file, otherwise I’d stick with the sysssislog table.

However, the log provider that is best for you will of course depend on the situation and how the log information will be used.