How do I execute a stored procedure in a SQL Agent job?

夙愿已清 提交于 2019-11-27 12:55:34

问题


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:

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


回答1:


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?




回答2:


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



来源:https://stackoverflow.com/questions/1216272/how-do-i-execute-a-stored-procedure-in-a-sql-agent-job

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!