Tuesday, March 27, 2012

Creating Alert..?

Hi all,
How can I create a alert that can be activated on Sql responses:
If I for example would like to send a email alert to a sales rep if the
revenue is to low.
Example: select custno, revenue from MyTable where revenue<1000
SQL-mail response: "The level is to low! for custno"
/Kent J.Kent,
1. Custom trigger --> xp_sendmail
2. Scheduled proc --> xp_sendmail
3. User Settable custom counter --> mail response
Also see:
http://www.sqldev.net/xp/xpsmtp.htm
HTH
Jerry
"Kent Johnson" <08.6044303@.telia.com> wrote in message
news:2VT5f.148747$dP1.506595@.newsc.telia.net...
> Hi all,
> How can I create a alert that can be activated on Sql responses:
> If I for example would like to send a email alert to a sales rep if the
> revenue is to low.
> Example: select custno, revenue from MyTable where revenue<1000
> SQL-mail response: "The level is to low! for custno"
> /Kent J.
>|||Jerry,
I have installed XPSMTP80.ZIP
This is what I have tried:
declare @.rc int
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = N'kentjohnson@.test1.com',
@.TO = N'kent.johnson@.test2.se'
select RC = @.rc
This is the result:
Error: connecting to server smarthost
RC
--
1
Can I send the result from a stored procedure in the mail?
How can I do that?
/Kent J.
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:#pvT02b1FHA.3336@.TK2MSFTNGP12.phx.gbl...
> Kent,
> 1. Custom trigger --> xp_sendmail
> 2. Scheduled proc --> xp_sendmail
> 3. User Settable custom counter --> mail response
> Also see:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH
> Jerry
> "Kent Johnson" <08.6044303@.telia.com> wrote in message
> news:2VT5f.148747$dP1.506595@.newsc.telia.net...
> > Hi all,
> >
> > How can I create a alert that can be activated on Sql responses:
> > If I for example would like to send a email alert to a sales rep if the
> > revenue is to low.
> > Example: select custno, revenue from MyTable where revenue<1000
> > SQL-mail response: "The level is to low! for custno"
> >
> > /Kent J.
> >
> >
>

No comments:

Post a Comment