Scheduling a SQL Stored Procedure
- Open SQL Server Management Studio and connect to your database
- In the object explorer, expand SQL Server Agent
- Right click on Jobs and select New Job...
- Enter a name for the Job
- On the Steps tab, click New...
- Give the step a name
- Leave the Type as "Transact-SQL script (T-SQL)"
- Select the Database
- Enter your SQL command in the Command box. This will usually be an EXEC statement
- Click OK to save the step
- Click the Schedules tab
- Click New... to create a new schedule
- Give the schedule a name
- Change the Frequency and Time to match the desired schedule
- Click OK to save the schedule
- If the server is configured to be able to send emails, you can set up email notifications if the job fails on the Notifications tab. This is optional.
- Click OK to save the Job
The SQL Server Agent job should now run on the interval you set up!