To capture all errors in an SSIS package

Script task to catch all SSIS errors.  I then used an email task to send out the error report.

 

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

 

Public Class ScriptMain

 

    'Capture Error

 

    Public Sub Main()

        Dim msgs As Collections.ArrayList

 

        Try

            msgs = CType(Dts.Variables("ErrorCollection").Value, Collections.ArrayList)

        Catch ex As Exception

            msgs = New Collections.ArrayList

        End Try

 

        msgs.Add(Dts.Variables("ErrorDescription").Value.ToString)

 

        Dts.Variables("ErrorCollection").Value = msgs

        Dts.Variables.Unlock()

 

        Dts.TaskResult = Dts.Results.Success

    End Sub

 

End Class

Print | posted on Friday, September 11, 2009 10:50 AM

Feedback

No comments posted yet.

Your comment:





 
 

Copyright © Kevin Shyr

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski