How to break a package by checking a condition

  • So here's my problem,

    I have about 100 or so names in a column. I have to check that if there is a new name being loaded, then break the package and send me an email. This clould be done even after the data is loaded into the table. I just need to know if there is a new name in that column.

    I was thinking about doing a SQL statement, but can't figure out how to break the package.

    Thanks.

    ------------
    🙂

  • How about a kind of split function that returns a table. (tvf)

    and performing a left outer join to the same tfv with the new contend.

    declare @mycolumn varchar(max)

    select @mycolumn = thecolumn

    from mytable

    Where thekey = @thekey

    Declare @mynewdata varchar(max)

    set @mynewdata= 'aaa,bbb,ccc'

    Select NEW.*

    from dbo.tvf_mysplit(mynewdata) NEW

    left join dbo.tvf_mysplit(@mycolumn) OLD

    on NEW.value = OLD.value

    where OLD.value is null

    if @@rowcount > 0

    begin

    --send mail logic

    end

    ps you can find split functions at SSC !:cool:

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • right, that would work.. but partially.

    I still need to know how to break the package..

    ------------
    🙂

  • search the package property "FailParentOnFailure". Set it to true.

    and play around with the "forcedexecutionresult",....

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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