Question

I have a .sql job that I want to run once every day between 2PM to 5PM. How can I schedule this?

Was it helpful?

Solution

1.Expand the SQL Server Agent node and right click the Jobs node in SQL Server Agent and select 'New Job'

2.In the 'New Job' window enter the name of the job and a description on the 'General' tab.

3.Select 'Steps' on the left hand side of the window and click 'New' at the bottom.

4.In the 'Steps' window enter a step name and select the database you want the query to run against.

5.Paste in the T-SQL command you want to run into the Command window and click 'OK'.

6.Click on the 'Schedule' menu on the left of the New Job window and enter the schedule information (e.g. daily and a time).

7.Click 'OK' - and that should be it.

OTHER TIPS

Use the SQL server agent. This is a service that comes with SQL server, and can be configured via enterprise management studio to execute SQL jobs at preconfigured times

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top