Powered By Blogger

Search

Tuesday, March 18, 2008

SQL a Stored Procedure to be Automatically Run

SQL a Stored Procedure to be automatically run

How to setup a stored procedure to be automatically run?

I needed to know how to schedule a stored procedure to run over and over! This is a brief step by step of how to get going. This isn't meant to hold your hand but get you going!
Here is a brief how-to steps!

1. Open SQL Enterprise Manager
2. Expand the database folder, Select your database if there are several databases
3. Left Single click on the place where it says stored procedures
4. Right click after selecting and choose new stored procedure
5. Create and save your stored procedure (Even has a syntax checker!)
6. Inside Enterprise Manager--Click on Tools, Job Scheduling (A wizard will appear)
7. Click Next
8 Leave Transact SQL-command selected, Click Next
9. Verify the database and in the big text box type -- EXEC storedprocedurename
10. Click Next
11. This will bring up a form that allow you to do whatever. Run now is selected. To make it a reoccurring stored proc the 5th option is that.
12. Schedule how you want the stored proc to run
13. Choose if you want to email or net send command. If you don't want anything click next
14. To modify or delete the job open SQL Enterprise Manager
15. Expand the Management Folder, Expand SQL Server Agent, select Jobs.
16. This is where all the info on the jobs that you created in Job Scheduler.
17. Right Click on the job and choose properties. That's it!

No comments: