Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Running a Stored Procedure at a Specific Time

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-14 : 11:04:28
Billy writes "How do I run a stored procedure at a specific time?"

chadmat
The Chadinator

1974 Posts

Posted - 2002-02-14 : 11:23:57
You can schedule a job.

In Enterprise Manager:
Under management, under SQL Server Agent, Jobs, right click, click new job.

Set your SP as the step, and create the schedule that you want.

-Chad

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-02-14 : 11:26:52
You would create a scheduled job that runs at the date and time of your choosing. You can do this using SQL Server Enterprise Manager; look under the Management folder, under SQL Server Agent, and there will be a folder for Jobs. You can right-click the mouse and choose to create a New Job.

Look at the Steps tab and add a new step. The type would be "Transact-SQL Script", choose the database where the stored procedure resides, then put this in the command window:

EXECUTE myStoredProcedureName

There is also a Schedules tab that you can fill out with the proper settings.

You can also do this using system stored procedures (sp_add_job, sp_add_job_step, sp_add_job_schedule, etc.) These are all documented in Books Online.

There you go Chad! You sniped me! We're EVEN! Curses!

Edited by - robvolk on 02/14/2002 11:28:06
Go to Top of Page
   

- Advertisement -