Open SQL Server Agend and right click the Jobs folder and select “New Job…”
General tab: fill out the name and owner.
Name: “AGR5-Daily”
The owner is the user that has the rights to run jobs.
Steps tab: select New
In the General tab you fill out Step name, Database and Command
Step name: “All daily run”
The database should be the staging database.
In the command type “EXEC [job].[all_daily_run]"
In the Advanced tab make sure to choose the appriopriate action in *“On success action”
If this is the last step (or only step) in the daily job, choose *“Quit the job reporting success”.
If you will be adding another step, choose “Go to the next step”
Finally, you go the Schedule tab and choose New to set appopriate schedule
First name the schedule e.g. “Daily
The timing depends on the setup. The ERP data needs to be ready and the transfer needs to be finished in the morning.
AGR Monthly job
Create new job in the same way as when creating the daily job.
Under the General tab you fill out the name and the owner
Step name: “AGR5 - Monthly”
The owner is the user that has the rights to run jobs.
Go into Steps tab and add new step by clicking New
In the General tab fill out Step name, Database
Step name: “Forecast - load locations”
The database: agr5_stg
Command: “EXEC [job].[run_forecasts_load_locations]”.
This is a procedure that creates a trigger by inserting all locations from the rep.locations table into a table named ctr.location_for_forecasting. If there are locations in this table, the forecast will be run for those locations in the daily job (as can be seen in the procedure job.all_daily_run).
Go to the Schedule tab and choose New to set the appropriate schedule.
Name: “Monthly”
The default is to run the monthly job on the first Saturday of every month, around midnight. However if the customer has other preferences then you set it according to that.