![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I have several fairly complex DTS packages that need to send an email not only upon completion, but also upon failure of any of the individual tasks within the package. The individual tasks update certain global variables that must be included in the body of the EMail. So, the solution I have tried is to set up a DynamicData task to update the parameters for an EMail task. I can get the Dynamic Data task to fire upon completion of the last actual step in the package, however I can't get it to work upon failure of a previous task. Any suggestions and/or sample code would be greatly appreciated. Thanks, Bob -- Bob Feldsien MCSD, MCDBA |
#2
| |||
| |||
|
|
You will need to use a separate mail task or "error handling task" per worker task. Use an On Failure constraint to link the two. Multiple constraints to one task will not work as the workflow engines uses AND logic in this scenario. Personally I find this too much hassle, but if you set package logging on to SQL, and have a second step to your job that runs after the package you can query the log and extract errors to send mails for any failures. This offers a single error check regardless of where in the package you experience a failure. -- Darren Green http://www.sqldts.com http://www.sqlis.com "Bob Feldsien" <Support (AT) Feldsien (DOT) com.invalid> wrote in message news:484DD8B9-67B6-46D8-82A6-4BA964E03D59 (AT) microsoft (DOT) com... I have several fairly complex DTS packages that need to send an email not only upon completion, but also upon failure of any of the individual tasks within the package. The individual tasks update certain global variables that must be included in the body of the EMail. So, the solution I have tried is to set up a DynamicData task to update the parameters for an EMail task. I can get the Dynamic Data task to fire upon completion of the last actual step in the package, however I can't get it to work upon failure of a previous task. Any suggestions and/or sample code would be greatly appreciated. Thanks, Bob -- Bob Feldsien MCSD, MCDBA |
#3
| ||||
| ||||
|
|
I certainly agree that this is a hassle. As you noted, multiple constraints to a single task never fire. This strikes me as a design flaw in DTS itself. Do you know if MS has addressed this in the next SQL Server version? Yes. You can choose between AND or OR logic, as well as a host of other cool |
|
I think the next thing I will try is to add some logic in the ActiveX script tasks that will redirect the package flow to the EMail task in the event of a failure, rather than using multiple Failure constraints. Requires a lot of coding and I think it woudl be much easier to implement |
|
I'm not as experienced with DTS as I would like, and frankly find the MS documentation to be somewhat superficial. I wonder if you, or any of the other readers, could recommend a book that will help me quickly bring my skills up to the next level. |
|
Thanks, Bob "Darren Green" wrote: You will need to use a separate mail task or "error handling task" per worker task. Use an On Failure constraint to link the two. Multiple constraints to one task will not work as the workflow engines uses AND logic in this scenario. Personally I find this too much hassle, but if you set package logging on to SQL, and have a second step to your job that runs after the package you can query the log and extract errors to send mails for any failures. This offers a single error check regardless of where in the package you experience a failure. -- Darren Green http://www.sqldts.com http://www.sqlis.com "Bob Feldsien" <Support (AT) Feldsien (DOT) com.invalid> wrote in message news:484DD8B9-67B6-46D8-82A6-4BA964E03D59 (AT) microsoft (DOT) com... I have several fairly complex DTS packages that need to send an email not only upon completion, but also upon failure of any of the individual tasks within the package. The individual tasks update certain global variables that must be included in the body of the EMail. So, the solution I have tried is to set up a DynamicData task to update the parameters for an EMail task. I can get the Dynamic Data task to fire upon completion of the last actual step in the package, however I can't get it to work upon failure of a previous task. Any suggestions and/or sample code would be greatly appreciated. Thanks, Bob -- Bob Feldsien MCSD, MCDBA |
![]() |
| Thread Tools | |
| Display Modes | |
| |