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


SSIS send mail question


SSIS send mail question

Author
Message
keithcorkran
keithcorkran
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 75
I am trying to create a package that reads email data from a tables based on if an email has already been sent.

The problem I'm having is updating the record after email acknowledgement from the SMTP server.

First Issue: I have no idea how to capture that negotiation.

Second Issue: Updating the table based on ID as to whether email sent
UPDATE tblNotification SET datSent =getdate()
WHERE ID = @P2
---where @P2 is a parameter that comes down and is loaded into the ForEach container (ForEach ADO Enumerator)

I'm having trouble finding somewhere a similar solution has been posted.

Any ideas welcomed.
Thanks,
Keith
WillyWonka
WillyWonka
SSC Veteran
SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)

Group: General Forum Members
Points: 251 Visits: 118
I have done something similar to this. Here's how I did.

1.) For each loop through your table sending you e-mails. Storing the EmailID you are working with in a user variable (i.e. User::EmailID).
2.) Execute your Send Mail Task
3.) Execute SQL Task

In your Execute SQL Task set the SQLStatment via the expressions tab.

Your expression would look something like this. Note I put single quotes around the variable and the date.

"UPDATE dbo.table SET DatSent = '" + CSTR(GETDATE()) + "' WHERE EmailID = '" + User::EmailID + "'"

There multiple ways to do this I just found this to be easier.


Hope this helps,

Eric
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