How to Fail a package when we encounter nulls in a desired column

  • I am getting data from a table in DB2 to sql server.I want my package to fail when I encounter nulls in a desired column.I used conditional transformation and in that i specified ISNULL condition.But I am not sure how to fail the package once the output comes from conditional split.If it doesnt have nulls,then it is fine,but if there are nulls,where should I direct my conditional split rows so that I can fail the package ......any ideas?

  • [font="Comic Sans MS"]

    Here is an 'always fail' is a custom script component - you can use. Simply create a script task and add the following line:

    Imports System

    Imports System.Data

    Imports System.Math

    Imports Microsoft.SqlServer.Dts.Runtime

    Public Sub Main()

    '

    ' Add your code here

    '

    Dts.TaskResult = Dts.Results.Failure

    End Sub

    End Class

    You can also use Dts.Events.FireError to throw appropriate message ..

    [/font]

    [font="Comic Sans MS"]--
    Sabya[/font]

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

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