From a recent email:
Customer has SOP batches that are created periodically without transactions in them and they want to clean them out on a regular basis. I have the script to do so but now I want to create a scheduled task in SQL Server 2005 to run this during off hours, say, weekly. What is the best way to accomplish this task? Customer is now running GP v10 but in this case, I don’t think it matters since table structures have not changed that I know of within this scenario.
Answer:
In SQL Server Management Studio, expand SQL Server Agent and right click on Jobs. Choose 'new job'

In the 'New Job' window, enter in a job name and description, then click on 'Steps'

Click 'New' at the bottom of the window to create a new step

In the 'New Job Step' window, enter in a step name, and a command to run the stored procedure. Or, if the code is simple enough, you could just paste the code here directly and skip the procedure. Click 'OK' to close this window.

Back in the 'New Job' window, click on 'schedules', click 'New' at the bottom of that window, and assign the job a schedule in the 'New Job Schedule' window. Any of the hilighted areas are applicable, you'll just choose the ones that are good for you.
