configure send email task

  • With that expression, you will send an e-mail every time your Error Count is greater than or equal to your Max Count. If you want to get an e-mail only when errors reach 20, then you need to set your max count to 20.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I got you but my question is that suppose while loading a data i just get one error, and my max condition is same upto 50, do I get an email message or not. Over all i need to get an email message whenever an errorcount is greater than 0 upto 50 limit.

  • Your current expression will not do that. In that case, you'd want your expression to evaluate to True when error count > zero and error count 0 || @[User::ErrorCount] <= @[User::MaxCount]

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • well i tested with the new expression, it will send an email even if there are o errors.

  • My bad. || is OR. You need && for AND. Replace the pipes w/ && and you should be good.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I tested with && also, and weird part is that it doesnt send any email on both condition? and on || it will send email on both condition.

  • So you ran it with && and verified that your error count variable was between 0 and 50? Did you use the debugging mode to verify the variable values?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Yes i verified with && and no email is sent when there are errors upto 50, and even i debug with toggle breakpoints, weird is that watch1 window is disabled. I have attached the scren shot.

  • Its disabled because the package thinks it is finished. It will never make it to the breakpoint if the expression does not evaluate to true.

    Remove the expression from the precedence constraint and re-run the package, using the same toggle point, to capture the variable values.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • here it goes

  • Given the variable values, wouldn't you expect there to be no e-mail?

    when ever there is an error upto 50 on a flat file it should send me an email,

    I thought you only wanted to send an e-mail if there was 1 - 50 errors?

    I would say that the expression is working just as we discussed.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Yes you are correct I need to send an email when ever error occurs from 1-50, on 0 error no email.

    I didnt undertand what you were trying to explain me in this message. Which expression you mean its working.

  • The expression is working. Your error count is 495. That is more than 50 so you should not get an e-mail.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I think you are confused, see this screnshot, i havent put any value on email expression so i wont get any email.

  • No, you set a breakpoint on that task. That prevents it from running until you tell SSIS to continue. If you exit debugging mode, the task will never run.

    The last expression that I posted will do what you asked it to do. Add the expression back into your precedence constraint, remove the break point, and re-run the package.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 15 posts - 16 through 30 (of 39 total)

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