This is a discussion on Periodic run of stored procedure within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, I have this stored procedure that I need to run daily, how do I do this? Thanks, Mike ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| One method is to schedule the proc execution using a SQL Server Agent job. You can create a job using the EM or SSMS GUI. -- Hope this helps. Dan Guzman SQL Server MVP "brogdonm" <Brogdons@gmail.com> wrote in message news:1135034300.442082.324910@g14g2000cwa.googlegr oups.com... > Hi, > > I have this stored procedure that I need to run daily, how do I do > this? > > Thanks, > Mike > <>< > |
| |||
| "brogdonm" <Brogdons@gmail.com> wrote in message news:1135036649.313243.99790@f14g2000cwb.googlegro ups.com... > Is it a bad idea to do something like > > WHILE (1<>0) > BEGIN > WAITFOR TIME '04:00' > . > . > . > END > > It seems like that would work as long as WAITFOR actually yields the > processor. There's far better ways of doing this, as Dan suggested, SQL Server agent is the way to do it. > > Mike, > <>< > |
| |||
| I've seen WAITFOR DELAY used in order to execute a proc at very frequent intervals (e.g. every minute or less). However, a scheduled job is a better fit for less frequent executions since that gives you job history and failure notification. -- Hope this helps. Dan Guzman SQL Server MVP "brogdonm" <Brogdons@gmail.com> wrote in message news:1135036649.313243.99790@f14g2000cwb.googlegro ups.com... > Is it a bad idea to do something like > > WHILE (1<>0) > BEGIN > WAITFOR TIME '04:00' > . > . > . > END > > It seems like that would work as long as WAITFOR actually yields the > processor. > > Mike, > <>< > |
| Thread Tools | |
| Display Modes | |
|
|