Search code examples
t-sqlstored-proceduressql-server-2012sql-agent-job

Executing a stored procedure in SQL Server 2012 using SQL Agent


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)


Solution

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