![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have created a SSIS package that loads a SQL 2005 table with data from an Excel Source. Error (row redirect) outputted to an flat file. I have added a Send mail task to the control flow, but cannot figure out how to conditionally cause it to execute when the data flow actually outputs rows to the error output. In the Contraint Editor between the Data Flow task and Send Mail task, I have set the contraint option to evaluate an expression @error_happened = true. @error_happened is a variable I defined but cannot figure out how to set within the data flow -- logically it should be set when the data flow outputs data to the error flat file. Any advise much appreciated. Thank you, Thomas |
#3
| |||
| |||
|
|
Hello thabrown, Ok So here's an idea. In the pipeline add a row number transform. This will count any redirected rows. In the control flow you have an expression on the constraint to the Send Mail Task that does something like @CountOfRedirectedRows > 0 is the name of your variable. Allan Hello, I have created a SSIS package that loads a SQL 2005 table with data from an Excel Source. Error (row redirect) outputted to an flat file. I have added a Send mail task to the control flow, but cannot figure out how to conditionally cause it to execute when the data flow actually outputs rows to the error output. In the Contraint Editor between the Data Flow task and Send Mail task, I have set the contraint option to evaluate an expression @error_happened = true. @error_happened is a variable I defined but cannot figure out how to set within the data flow -- logically it should be set when the data flow outputs data to the error flat file. Any advise much appreciated. Thank you, Thomas |
#4
| |||
| |||
|
|
Thanks, Allan! That was a simple solution. I even added the rowcount variable to my message. I appreciate your quick response and help. Although this solves this particular issue, I'd be interested to hear about other examples people may have of email tasks in SSIS packages that send detailed error information. Any event handlers examples, for instance? Thank you, Thomas "Allan Mitchell" wrote: Hello thabrown, Ok So here's an idea. In the pipeline add a row number transform. This will count any redirected rows. In the control flow you have an expression on the constraint to the Send Mail Task that does something like @CountOfRedirectedRows > 0 is the name of your variable. Allan Hello, I have created a SSIS package that loads a SQL 2005 table with data from an Excel Source. Error (row redirect) outputted to an flat file. I have added a Send mail task to the control flow, but cannot figure out how to conditionally cause it to execute when the data flow actually outputs rows to the error output. In the Contraint Editor between the Data Flow task and Send Mail task, I have set the contraint option to evaluate an expression @error_happened = true. @error_happened is a variable I defined but cannot figure out how to set within the data flow -- logically it should be set when the data flow outputs data to the error flat file. Any advise much appreciated. Thank you, Thomas |
![]() |
| Thread Tools | |
| Display Modes | |
| |