Showing posts with label e-mail. Show all posts
Showing posts with label e-mail. Show all posts

Tuesday, March 20, 2012

alert e-mail

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,
GBThere 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 particula
r
> 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|||Thank you, xp_sendmail is working OK.
GB
"Tracy McKibben" <tracy.mckibben@.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:
daily
particular
sent to
>

alert

Hi
I have SQL Server Mail configured and working correctly, but I was just
wondering if it were possible to send an e-mail alert to an operator
indicating that a SQL Server service had stopped? If so, how do I go about it?
ThanksHi
Write a stored procedure that trying to ping the server. If it got 'time out
..' then send the email.
"jonjo" <jonjo@.discussions.microsoft.com> wrote in message
news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
> Hi
> I have SQL Server Mail configured and working correctly, but I was just
> wondering if it were possible to send an e-mail alert to an operator
> indicating that a SQL Server service had stopped? If so, how do I go about
it?
> Thanks|||Hi
Thanks for the reply. I've not done much development or sp work so could you
point me in the right direction as how to start writing the sp in question?
Thanks
"Uri Dimant" wrote:
> Hi
> Write a stored procedure that trying to ping the server. If it got 'time out
> ...' then send the email.
>
>
> "jonjo" <jonjo@.discussions.microsoft.com> wrote in message
> news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
> > Hi
> >
> > I have SQL Server Mail configured and working correctly, but I was just
> > wondering if it were possible to send an e-mail alert to an operator
> > indicating that a SQL Server service had stopped? If so, how do I go about
> it?
> >
> > Thanks
>
>|||Hi
I think you'd be better off finding a moitoring tool that can monitor the
SQL server service, and then let this tool email you when the service is
down. Additonally, if you use SQL Server Agent to do the monitoring, I doubt
that you can trust the result to check the server it self. SQL Server Agent
requires MSSQLSERVER to be running, so if the SQLserver service is down, SQL
server agent is most likely down as well.
Regards
Steen
jonjo wrote:
> Hi
> Thanks for the reply. I've not done much development or sp work so
> could you point me in the right direction as how to start writing the
> sp in question?
> Thanks
> "Uri Dimant" wrote:
>> Hi
>> Write a stored procedure that trying to ping the server. If it got
>> 'time out ...' then send the email.
>>
>>
>> "jonjo" <jonjo@.discussions.microsoft.com> wrote in message
>> news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
>> Hi
>> I have SQL Server Mail configured and working correctly, but I was
>> just wondering if it were possible to send an e-mail alert to an
>> operator indicating that a SQL Server service had stopped? If so,
>> how do I go about it?
>> Thankssql

alert

Hi
I have SQL Server Mail configured and working correctly, but I was just
wondering if it were possible to send an e-mail alert to an operator
indicating that a SQL Server service had stopped? If so, how do I go about it?
Thanks
Hi
Write a stored procedure that trying to ping the server. If it got 'time out
...' then send the email.
"jonjo" <jonjo@.discussions.microsoft.com> wrote in message
news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
> Hi
> I have SQL Server Mail configured and working correctly, but I was just
> wondering if it were possible to send an e-mail alert to an operator
> indicating that a SQL Server service had stopped? If so, how do I go about
it?
> Thanks
|||Hi
Thanks for the reply. I've not done much development or sp work so could you
point me in the right direction as how to start writing the sp in question?
Thanks
"Uri Dimant" wrote:

> Hi
> Write a stored procedure that trying to ping the server. If it got 'time out
> ...' then send the email.
>
>
> "jonjo" <jonjo@.discussions.microsoft.com> wrote in message
> news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
> it?
>
>
|||Hi
I think you'd be better off finding a moitoring tool that can monitor the
SQL server service, and then let this tool email you when the service is
down. Additonally, if you use SQL Server Agent to do the monitoring, I doubt
that you can trust the result to check the server it self. SQL Server Agent
requires MSSQLSERVER to be running, so if the SQLserver service is down, SQL
server agent is most likely down as well.
Regards
Steen
jonjo wrote:[vbcol=seagreen]
> Hi
> Thanks for the reply. I've not done much development or sp work so
> could you point me in the right direction as how to start writing the
> sp in question?
> Thanks
> "Uri Dimant" wrote:

alert

Hi
I have SQL Server Mail configured and working correctly, but I was just
wondering if it were possible to send an e-mail alert to an operator
indicating that a SQL Server service had stopped? If so, how do I go about i
t?
ThanksHi
Write a stored procedure that trying to ping the server. If it got 'time out
..' then send the email.
"jonjo" <jonjo@.discussions.microsoft.com> wrote in message
news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
> Hi
> I have SQL Server Mail configured and working correctly, but I was just
> wondering if it were possible to send an e-mail alert to an operator
> indicating that a SQL Server service had stopped? If so, how do I go about
it?
> Thanks|||Hi
Thanks for the reply. I've not done much development or sp work so could you
point me in the right direction as how to start writing the sp in question?
Thanks
"Uri Dimant" wrote:

> Hi
> Write a stored procedure that trying to ping the server. If it got 'time o
ut
> ...' then send the email.
>
>
> "jonjo" <jonjo@.discussions.microsoft.com> wrote in message
> news:6312060A-0A9A-4D3D-BC38-BE221D10B87C@.microsoft.com...
> it?
>
>|||Hi
I think you'd be better off finding a moitoring tool that can monitor the
SQL server service, and then let this tool email you when the service is
down. Additonally, if you use SQL Server Agent to do the monitoring, I doubt
that you can trust the result to check the server it self. SQL Server Agent
requires MSSQLSERVER to be running, so if the SQLserver service is down, SQL
server agent is most likely down as well.
Regards
Steen
jonjo wrote:[vbcol=seagreen]
> Hi
> Thanks for the reply. I've not done much development or sp work so
> could you point me in the right direction as how to start writing the
> sp in question?
> Thanks
> "Uri Dimant" wrote:
>