Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to run a stored procedure at predefined intervals?

I wanted a stored procedure to run at specified intervals everyday. Is there a way to do the same on SQL Server 2005?

I know we can create a batch file to run SP and schedule it with windows scheduled tasks but is there a way to do it from SQL Server itself?

like image 540
Amit Avatar asked Feb 09 '10 05:02

Amit


2 Answers

You can create jobs with sql server 2005

like image 32
x2. Avatar answered Sep 30 '22 23:09

x2.


There's a separate service called SQL Agent, which is created for this specific purpose: scheduling of tasks related to SQL Server.

This is a Windows Service that's initially disabled, so you'll have to enable that. Otherwise, it's all very straightforward: Management Studio has nice UI for managing Agent.

like image 94
Anton Gogolev Avatar answered Oct 01 '22 01:10

Anton Gogolev