How to run a stored procedure on a daily /weekly/monthly basis?

por | 27 julio, 2022

In SQL Server, you should use JOBS to run a stored procedure based on schedule.

  1. Open SQL Server Management Studio.
  2. Expand SQL Serve Agent.
  3. Right-click on jobs and select a new job.
    new job in SQL Server
  4. Provide a name for the job and description.
  5. Click on the steps option> click new.
  6. Write the name of the step.
  7. Select the type of step.
  8. Select the database that has the stored procedure.
  9. Write the below command to execute a stored procedure. Exec Stored_procedure_Name
  10. Click Ok.
  11. Again, click on Schedule and click the new button
  12. Add the name of the schedule.
  13. Specify the time of starting job and start date as you prefer and then click ok