How do I execute a stored procedure in a SQL Agent

2020-02-08 06:44发布

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.

Here is my screen snapshot:

enter image description here

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

2条回答
\"骚年 ilove
2楼-- · 2020-02-08 07:32

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?

查看更多
Luminary・发光体
3楼-- · 2020-02-08 07:38

As Marc says, you run it exactly like you would from the command line. See Creating SQL Server Agent Jobs on MSDN.

查看更多
登录 后发表回答