Wednesday, March 7, 2012

Is there any way to have an email sent on an event

I'm using SQL with an Access form for the front end. Is there anyway to have an email sent on the trigger of an event within the form? I'm not sure where to even begin.

A good place to start is Books Online. Look up Triggers, SQL Agent, Jobs.

The path you are headed down has a short but steep learning curve.

|||

Unless you are using SQL Server 2005, you should not use the trigger approach to send email directly. This is due to the fact that triggers behave synchronously letting your transaction wait for the response of the external mail sending application / procedure. This could stale your transaction process and let other users wait for ressources to transaction might block. SQL Server uses SQL Server Service broker for sending mails with the DBMail, putting the mail in a queue, sending the mail asynchronously. For SQL Server 2000 you would have to implement your custom solution, writing an entry in a table with the appropiate mail information and grabbing the information from the table periodically to send the emails via an agent job.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

No comments:

Post a Comment