SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


send email of all defaulters


send email of all defaulters

Author
Message
abhas
abhas
SSC Eights!
SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)

Group: General Forum Members
Points: 938 Visits: 664
Hi,
Please help on below scenario to send mail.

I am having a table which contains student attendance. If student is absent then the mail should automatically goes to HOD. But issue is that i don't want to send mail one for each student.
Suppose there is maths department and 7 students are absent then all 7 students name i want to send to HOD by the mail. I am able to send but 7 mails are going. Can you please help? its urgent.


Thanks
Abhas
jeetsingh.cs
jeetsingh.cs
Mr or Mrs. 500
Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)

Group: General Forum Members
Points: 561 Visits: 618
you can use the procedure to first have the list of students
absent in a particular department and then use the procedure
sp_send_dbmail to send the list of absentees in the mail.
abhas
abhas
SSC Eights!
SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)

Group: General Forum Members
Points: 938 Visits: 664
Hi Jeet,

I want to use this by using SSIS.

Thanks
Abaso jadhav
rhythm.varshney
rhythm.varshney
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 195
abhas (12/4/2012)
Hi Jeet,

I want to use this by using SSIS.

Thanks
Abaso jadhav


Store the names of student in string variable using Execute Sql Task and then use send mail task to send mail.
abhas
abhas
SSC Eights!
SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)

Group: General Forum Members
Points: 938 Visits: 664
Hi rhythm

I am doing the same but emails are going repeatedly.
Example if there are 5 students then 5 different mails are going.

Thanks
Abhas.
rhythm.varshney
rhythm.varshney
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 195
abhas (12/5/2012)
Hi rhythm

I am doing the same but emails are going repeatedly.
Example if there are 5 students then 5 different mails are going.

Thanks
Abhas.


Probably you have include your mail task in loop container or so.
Please check and if not then attach screenshots or explain your package ?
abhas
abhas
SSC Eights!
SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)SSC Eights! (938 reputation)

Group: General Forum Members
Points: 938 Visits: 664
Hi rhythm,

I am doing below steps.

1) Execute sql task - here I am fetching studid,studname,deptname,HodName,HodMail.
2) I am using foreach loop
3) In foreach loop I am using script task and sendmail task

In script task I am fetching mailid's and writting body of message. But what happens in this case suppose there are 3 students belongs to physics dept then 3 separate mails are going to HOD.

I want to send single mail for three students as;

Dear Sir,
student1,student2,student3 are absent today.Please take required action.


Thanks
Abaso Jadhav
rhythm.varshney
rhythm.varshney
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 195
abhas (12/5/2012)
Hi rhythm,

I am doing below steps.

1) Execute sql task - here I am fetching studid,studname,deptname,HodName,HodMail.
2) I am using foreach loop
3) In foreach loop I am using script task and sendmail task

In script task I am fetching mailid's and writting body of message. But what happens in this case suppose there are 3 students belongs to physics dept then 3 separate mails are going to HOD.

I want to send single mail for three students as;

Dear Sir,
student1,student2,student3 are absent today.Please take required action.


Thanks
Abaso Jadhav


Thats what I doubted.Use send mail task outside for each loop.
I hope you are using package level variable for stroing email ids.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search