如何每小时在sql server中运行一个存储过程?

2023-09-20数据库问题
0

本文介绍了如何每小时在sql server中运行一个存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一张桌子,我想每小时在上面执行一些操作.为此,我创建了一个存储过程,但不知道如何每小时调用它.我知道有一些预定的工作,但如何使用它们.

I have a table on which I want to perform some operations every hour. For this I created a Stored Procedure but don't know how to call it every hour. I know there are some kind of scheduled jobs, but how to use them.

是否还有某种服务可以每秒持续运行,以便我可以将要执行的代码片段放置在其中?

Is there some kind of service also that keeps on running continuously, every second, where I can place my piece of code to be executed ?

推荐答案

在 SSMS 中导航到 SQL Server Agent-->Jobs右键单击作业文件夹并选择新作业

In SSMS navigate to SQL Server Agent-->Jobs Right click on the Job Folder and select new job

在弹出的对话框中,给工作起个名字单击步骤,然后单击新建,您将看到如下所示的对话框,选择正确的数据库并输入您的 proc 名称

on the dialog that pops up, give the job a name click on steps, then on new, you will see a dialog like the following, pick correct DB and type your proc name

点击日程后,选择新的,您将看到如下图所示的内容,填写您需要的所有内容并单击确定,在作业上单击确定,您应该设置

after that click on schedule, pick new and you will see something like the image below, fill all the stuff you need and click ok, click ok on the job and you should be set

这篇关于如何每小时在sql server中运行一个存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Mysql目录里的ibtmp1文件过大造成磁盘占满的解决办法
ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致...
2025-01-02 数据库问题
151

按天分组的 SQL 查询
SQL query to group by day(按天分组的 SQL 查询)...
2024-04-16 数据库问题
77

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

MySQL groupwise MAX() 返回意外结果
MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)...
2024-04-16 数据库问题
13

MySQL SELECT 按组最频繁
MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)...
2024-04-16 数据库问题
16

在 Group By 查询中包含缺失的月份
Include missing months in Group By query(在 Group By 查询中包含缺失的月份)...
2024-04-16 数据库问题
12