February 2, 2010 at 8:01 am
I have a foreach loop container which processes 'n' number of files.I have to extract a part of the name of the file and include it in the email after the task is successful.
The thing is after processing 'n' number of files , I don't need 'n' number of emails.I need only one email which has details of the n files.For this I started using script task with arrays.But I am not very good at VB.net which is giving me different kind of errors.Can we do it any way other than using script task?If script task is the only option,can you guys tell me how to do it?
Thanks....
February 3, 2010 at 7:06 am
You could use an Expression that is Counter for each file and is updated for each file that is read.
Then refer to the expression's value when you generate the e-mail.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 3, 2010 at 7:11 am
Thanks for the reply...Can u elaborate on the point you made?
February 3, 2010 at 7:17 am
Create a Package Level Expression @Counter
Set the INtail Value to Zero
Right click on the For Loop COntainer and Choose Edit
Set the InitCount = @Counter
Set the AssignExpression Property to @Counter = @Counter + 1
I had a complete solution that included the counter as well a concationated the path and components of the file namne but it was lost when I had to reformat my machine.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 3, 2010 at 7:21 am
Have you looked at the send mail task?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 3, 2010 at 7:29 am
i have declared a package variable counter with a value 0.
@Count=0
In For loop i have
InitExpression @Counter
EvalExpression
AssignExpression @Counter+1
What should be there in evalExpression and should the email task be in the For Loop or out of the For loop?
Thanks,
Srikanth
February 3, 2010 at 7:36 am
Typically you would have a @MaxCounter or a hard code value.
I believe that you want to assign @Counter = 1.
The send mail task may not work for you.
I have used the expression to specify values in the form, to and e-mail attachment.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply