如何在 SQL 代理作业中执行存储过程? [英] How do I execute a stored procedure in a SQL Agent job?

查看:49
本文介绍了如何在 SQL 代理作业中执行存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 SQL Server 2008,我需要从 SQL Server 代理运行 SQL 作业.我是 SQL Server 作业的新手,我想定期从 SQL Server 作业执行存储过程.但是除了copy &我没有找到在哪里指定执行的存储过程.粘贴 SQL 命令.

I am using SQL Server 2008 and I need to run a SQL Job from SQL Server Agent. I am new to SQL Server Job and I want to execute a stored procedure regularly from a SQL Server Job. But I did not find where to specify the executed stored procedure other than copy & paste SQL commands.

这是我的屏幕截图:

任何想法如何分配存储过程以在 SQL Server 作业中执行?

Any ideas how to assign stored procedure to execute in SQL Server Job?

推荐答案

你只需要在窗口中添加这一行:

You just need to add this line to the window there:

exec (your stored proc name) (and possibly add parameters)

您的存储过程调用了什么,它期望什么参数?

What is your stored proc called, and what parameters does it expect?

这篇关于如何在 SQL 代理作业中执行存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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