如何为sql查询计划一个作业每天运行? [英] how to schedule a job for sql query to run daily?

查看:157
本文介绍了如何为sql查询计划一个作业每天运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

    我需要知道如何使用sql server代理作业每天运行sql查询。 >
  1. 展开SQL Server代理节点,右键单击SQL Server代理中的Jobs节点,然后选择'New Job'


  2. '新建作业'窗口中输入作业的名称和'General'标签。


  3. 窗口左侧,然后单击底部的'新建


  4. c $ c>'Steps'窗口输入步骤名称,并选择要运行查询的数据库。


  5. 在T-SQL命令中,您要运行到命令窗口,然后单击'OK'


  6. 点击新建作业窗口左侧的'计划'菜单,输入计划信息(例如每日和时间)。


  7. 点击'OK' - 这应该是。


(当然还有其他选项可以添加 - 但我认为这是您设置和安排工作所需的最低限度)


I need to know how to make an sql query run daily using sql server agent jobs with minimum required configuration settings.

解决方案

  1. Expand the SQL Server Agent node and right click the Jobs node in SQL Server Agent and select 'New Job'

  2. In the 'New Job' window enter the name of the job and a description on the 'General' tab.

  3. Select 'Steps' on the left hand side of the window and click 'New' at the bottom.

  4. In the 'Steps' window enter a step name and select the database you want the query to run against.

  5. Paste in the T-SQL command you want to run into the Command window and click 'OK'.

  6. Click on the 'Schedule' menu on the left of the New Job window and enter the schedule information (e.g. daily and a time).

  7. Click 'OK' - and that should be it.

(There are of course other options you can add - but I would say that is the bare minimum you need to get a job set up and scheduled)

这篇关于如何为sql查询计划一个作业每天运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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