user269186
user269186

Reputation: 127

Create Insert Trigger for SQLAgentMail

Is it possible to create a trigger the will use SQLAgentMail and email an operator?

Upvotes: 0

Views: 83

Answers (1)

HLGEM
HLGEM

Reputation: 96552

It is generally not a good idea to write a trigger to send anemail, do you really want users to be locked out of changing the table is the email server is down?

Usually the process is that you send the info you want in the email to a table in the trigger and then write a job that looks in the emails to send table, sends the emails and updates that they were sent. This job runs every five minutes or so. This is close to real time without the problem of breaking the table if the email is down. It also gives a nice record of what emails were sent which can be handy at times.

Upvotes: 1

Related Questions