使用Sql Server 2008安排作业 [英] Scheduling a job using Sql Server 2008

查看:104
本文介绍了使用Sql Server 2008安排作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个存储的proc,它从运行查询返回行数的计数.我想安排一个运行此存储的proc的作业,并在count为0时向人们发送电子邮件.

我如何使用SqlserverAgent-> jobs做到这一点.

非常感谢.

Hi,

I have a stored proc that returns a count of number of rows from running a query. I want to schedule a job that runs this stored proc and emails people if count is 0.

how do I do this using SqlserverAgent-->jobs.

Many thanks .

推荐答案

检查此链接:

http://www.howtogeek.com /howto/database/sending-automated-job-email-notifications-in-sql-server-with-smtp/ [
Check this link:

http://www.howtogeek.com/howto/database/sending-automated-job-email-notifications-in-sql-server-with-smtp/[^]


不是确定您使用的是哪个版本的SQL Server.但是,您可能会发现以下信息对此有用.

发送电子邮件.
http://msdn.microsoft.com/en-us/library/ms175887.aspx

http://msdn.microsoft.com/en-us/library/ms190307.aspx

要创建新作业并在该作业中配置存储过程.
http://msdn.microsoft.com/en-us/library/ms190268.aspx

安排您的工作.
http://msdn.microsoft.com/en-us/library/ms191439.aspx
Not sure which version of SQL Server you are using. However you may find below information useful for this.

To send emails.
http://msdn.microsoft.com/en-us/library/ms175887.aspx

http://msdn.microsoft.com/en-us/library/ms190307.aspx

To craete a new Job and configure your Stored Procedure in the Job.
http://msdn.microsoft.com/en-us/library/ms190268.aspx

To schedule your Job.
http://msdn.microsoft.com/en-us/library/ms191439.aspx


有一种更简单的方法.

http://msdn.microsoft.com/en-us/library/ms190307.aspx [ ^ ]

我是从存储过程中调用此函数的,响应是立即的.我不必为此设置任何其他功能.
There is an easier way.

http://msdn.microsoft.com/en-us/library/ms190307.aspx[^]

I called this from a stored procedure and the response was immediate. I did not have to set up anything additional for this to work.


这篇关于使用Sql Server 2008安排作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆