May 31, 2007 at 12:34 am
Hello
Requirement: Send an email when an invoice is generated to customer that is on hold.
I can identify all on hold invoices for today where cust is on hold and I can send email using xpsmtp. My question is what is the most efficient way of getting to the final email. I admit I am not a programmer but if I have the logic I will be able to apply it.
Do I execute a Stored proc for every insert on the invoice table, would this affect server performance?
Or would you use some sort of temp table and compare it to a view on the invoice table?
May 31, 2007 at 2:27 am
you could fire a trigger at insert time that records the invoice-key(s) to a staging table and have that staging table qeuried every x-minutes by a job that sends the email(s).
This way the overhead on the transaction can be minimal.
(if you send the mail in the trigger, if the mail fails for whatever reason, your transaction will fail, so your insert will be aborted)
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply