0

I'm new to SQL Server and I've been looking through this thread: how to execute a stored procedure in a SQL Agent job? .

I'm posting a new question as to not bump a 5 year old question.

I have a stored procedure called dbo.Test_CreateCombinedLeads as far as I know it does not require any additional parameters.

(I am unable to post pictures yet)

Would using this line of code in the command section (as seen question link)

exec [dbo].[Test_CreateCombinedLeads]

run my stored procedure or would I need more?

(Note: I do have the database dropdown set to the one the store procedure comes from)

Community
  • 1
  • 1
james f.
  • 3
  • 3
  • what makes you feel this would not be a duplicate of the question you linked? – bummi Oct 28 '14 at 21:37
  • possible duplicate of [how to execute a stored procedure in a SQL Agent job?](http://stackoverflow.com/questions/1216272/how-to-execute-a-stored-procedure-in-a-sql-agent-job) – bummi Oct 29 '14 at 09:45

2 Answers2

0

That would execute your procedure as long as you set it to execute from correct databes in the agent job.

0

Just add a line:

use [your database name]

before your exec command.

Nekud
  • 11
  • 3