Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling a job to run a stored procedure

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm relatively new to SQL server. We're looking at scheduling a job such that we run a stored procedure (call it Test1) on a daily basis (taking a snapshot of data, for instance). Can someone provide us with a simplistic example of this that we can build on ?
Thanks in advance.
Steve
 
Write your stored procedure and install it in SQLServer.
Using enterprise manager, goto Management/SQL Server Agent/Jobs, Right click and create a new job. Add a new Step, a TSQL script in the database you require with the command:

Execute SP_Test1

Add a new schedule to run the task Once a day at a certain time.

Add a name for the job and hey presto it should go away and run your stored procedure every day.

The only thing you need to ensure is that SQLServerAgent is running, but it should be by default.

Hope this helps,

Chris Dukes
 
Thanks for the pointer with this one Chris - we now have a scheduled job to run as required.
Thanks again.
Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top