Home All Groups Group Topic Archive Search About
Author
8 Jun 2006 7:51 PM
GB
Hello:
In SQL Server 2000 database I have a table MyTable which is updated daily
with previous day data. In some reason data could be missing for particular
day. To control the situation I'd like to create alert message to be sent to
me by e-mail.
The verification SQL statement is:
IF (select DATEDIFF ( day , max(datadate) , GetDate() )from MyTable) >1
print 'ALERT!'

How can I get the verification result by e-mail?

Thanks,
GB

Author
8 Jun 2006 8:14 PM
Tracy McKibben
There are generally three ways to send email from SQL 2000:

1. Install Outlook on the server and configure SQL Mail.  You can then
use xp_sendmail to send emails.

2. Use xp_smtp_sendmail:  http://www.sqldev.net/xp/xpsmtp.htm

3.  Use a command-line mailer such as "Blat" in combination with
xp_cmdshell

I've used all three, and all three work well.


GB wrote:
Show quoteHide quote
> Hello:
> In SQL Server 2000 database I have a table MyTable which is updated daily
> with previous day data. In some reason data could be missing for particular
> day. To control the situation I'd like to create alert message to be sent to
> me by e-mail.
> The verification SQL statement is:
> IF (select DATEDIFF ( day , max(datadate) , GetDate() )from MyTable) >1
> print 'ALERT!'
>
> How can I get the verification result by e-mail?
>
> Thanks,
> GB
Are all your drivers up to date? click for free checkup

Author
8 Jun 2006 8:44 PM
GB
Thank you,  xp_sendmail is working OK.

GB


Show quoteHide quote
"Tracy McKibben" <tracy.mckib***@gmail.com> wrote in message
news:1149797645.683037.46670@i39g2000cwa.googlegroups.com...
> There are generally three ways to send email from SQL 2000:
>
> 1. Install Outlook on the server and configure SQL Mail.  You can then
> use xp_sendmail to send emails.
>
> 2. Use xp_smtp_sendmail:  http://www.sqldev.net/xp/xpsmtp.htm
>
> 3.  Use a command-line mailer such as "Blat" in combination with
> xp_cmdshell
>
> I've used all three, and all three work well.
>
>
> GB wrote:
> > Hello:
> > In SQL Server 2000 database I have a table MyTable which is updated
daily
> > with previous day data. In some reason data could be missing for
particular
> > day. To control the situation I'd like to create alert message to be
sent to
> > me by e-mail.
> > The verification SQL statement is:
> > IF (select DATEDIFF ( day , max(datadate) , GetDate() )from MyTable) >1
> > print 'ALERT!'
> >
> > How can I get the verification result by e-mail?
> >
> > Thanks,
> > GB
>

Bookmark and Share