Sunday, March 25, 2012

Alerts to be emailed to our team

We have a few procedures we want to monitor for issues... and want to know
how to enable alerts to notify our team when there is an issue..
We have error logging enabled within the procedure.. which is writing the
errors to a table, but unless we go out and view that table we dont know if
the procedure failed...
So what can we use within the SQL2005 to send our team an email that the
procedure failed?
we have alerts working with our scheduled Jobs but want to use it to alert
of the errors as they are written to the table or within the procedure..
whatever is easier...
ASP, SQL2005, DW8 VBScript
Daniel,
Provided this is not high-velocity stuff, but is fairly rare, you could add
an ON INSERT trigger to your audit table. That trigger could then do
something such as:
1. Use sp_send_dbmail to email your group
2. Use sp_start_job to start a SQL Agent job that could do whatever you
want, including sending the email.
3. Use RAISERROR to raise an alert that is configured to email, page, etc,
whoever you want to have know about this.
And so on.
If the errors were frequent it would probably be better to skip the trigger,
but create a scheduled job that occasionally runs (every hour?) and reports
on recent activity.
RLF
"Daniel" <dan_c@.h.com> wrote in message
news:O0Zij28fIHA.4260@.TK2MSFTNGP05.phx.gbl...
> We have a few procedures we want to monitor for issues... and want to know
> how to enable alerts to notify our team when there is an issue..
> We have error logging enabled within the procedure.. which is writing the
> errors to a table, but unless we go out and view that table we dont know
> if the procedure failed...
> So what can we use within the SQL2005 to send our team an email that the
> procedure failed?
> we have alerts working with our scheduled Jobs but want to use it to alert
> of the errors as they are written to the table or within the procedure..
> whatever is easier...
> --
> ASP, SQL2005, DW8 VBScript
>

No comments:

Post a Comment