Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to schedule a stored procedure?

Tags:

How do I schedule a stored procedure in Sql Server 2005 that it runs once at the start of every month (and on database startup)?

like image 836
Stefan Steiger Avatar asked Feb 26 '10 16:02

Stefan Steiger


People also ask

How do I schedule a stored procedure in SQL?

Expand SQL Server Agent, expand Jobs, right-click the job that you want to schedule, and click Properties. Select the Schedules page, and then click Pick. Select the schedule that you want to attach, and then click OK.

Can a stored procedure run on a schedule?

You can use the administrative task scheduler to execute stored procedures at a specific time. You must first define a task for the stored procedure execution. Then, when the specified time or event occurs for the stored procedure to run, the administrative task scheduler calls the stored procedure.

How do I view a stored procedure schedule?

job_id = j. job_id AND s. command LIKE '%procedurename%' ); Using this approach you could list all your store procedures (by name) and then find all jobs (or steps to be more specific) that contain these store procedures.


1 Answers

You will need to create a job using the SQL Server Agent.

like image 76
Chris Porter Avatar answered Sep 18 '22 21:09

Chris Porter