sql作业失败时发送邮件 [英] Send mail when sql job fails
问题描述
我有一份SQL工作。如果作业失败/成功,我想将邮件发送给用户。
为此,我在下创建了一个运算符 SQL Server代理并在通知选项下的电子邮件名称文本框中放下我的电子邮件地址。
然后,在我创建的SQL作业的 Properties 上,在 Alerts 部分下,我创建了 new 警报。选中通知操作员复选框并选中新创建的操作员。
我认为这是我们接收邮件时必须做的事情工作失败/成功。
但是我无法收到任何邮件。当我检查错误日志时,它显示了此错误消息,错误,[264]当没有建立电子邮件会话时,尝试发送电子邮件
我提到了这个 http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/32a2c09a-156f-43b2-9076-b11ba9ccdafb/ [ ^ ]
链接的帮助,但启动/停止/重启SQL Server代理没有帮助。
任何人都可以帮助我sql作业完成后收到邮件???
任何帮助表示赞赏。
谢谢,
Lok ..
Hi,
I have a SQL job. If the job fails / succeeds, I want to send the mail to user.
For this, I created an operator under SQL Server Agent and put down my email address in the E-mail name text box under Notification Options.
Then, on the Properties of my created SQL job, under the Alerts section, I created new alert. Checked the Notify Operators check box and selected the newly created Operator.
I think this is what we have to do to receive mail if the job fails/succeeds.
But I am not able to receive any mail. When I checked the Error Log, it showed me this error message, "Error,[264] An attempt was made to send an email when no email session has been established"
I referred this http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/32a2c09a-156f-43b2-9076-b11ba9ccdafb/[^]
link for the help but start/ stop/ restart of SQL Server Agent is of no help.
Can anybody help me to receive mail after the sql job completes???
Any help appreciated.
Thanks,
Lok..
推荐答案
这篇CP文章可能对你有所帮助
SQL SERVER - 2008 - 配置数据库邮件 - 从SQL数据库发送电子邮件 [ ^ ]
This CP article might help you
SQL SERVER - 2008 - Configure Database Mail - Send Email From SQL Database[^]
退房:
SQL Server 2008创建和安排工作
安排使用SQL Server 2008自动备份
如何:安排工作(SQL Server Management Studio)
使用SQL Server代理安排管理任务 [ ^ ]
安排SQL Server代理作业 [ ^ ]
在SQL Server中添加sql作业的分步过程 [ ^ ]
Check out:
SQL Server 2008 -Create and Schedule Job
Scheduling automated backup using SQL server 2008
How to: Schedule a Job (SQL Server Management Studio)
Scheduling Administrative Tasks Using SQL Server Agent[^]
Scheduling SQL Server Agent Jobs[^]
Step by Step process of adding a sql job in SQL Server[^]
我根据需要设置了所有内容我已在我的问题中描述过,但不知道为什么我没有收到任何邮件。昨天我也多次重启机器,但没有运气。
今天当我打开邮箱时,我开始接收邮件完成sql作业。
我还有更多的问题,但我会开始一个新的线程。
谢谢大家。
I had set up everything as needed and as I already described in my question, but don''t know why I was not receiving any mail. I had also restarted me machine so many times yesterday but to no luck.
Today when I opened my mailbox, I started receiving mails for the sql job completion.
I still have few more questions about it, but I will start a new thread instead.
Thanks everyone.
这篇关于sql作业失败时发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!