SQL Server 2008 Agent jobs. Two procedures and a view

223 views Asked by At

I'm using two stored procedures a view to create report.

Every 3 months, I have to update these two stored procedures and view automatically.

First, I should update stored procedure 1

Then, I need to update view (it takes data from stored procedure 1)

Finally, I need to update stored procedure 2 (it takes data form stored procedure 1 and from the view)

To do this, I would like to use SQL Server Agent jobs. Is it possible to run one SQL Server Agent job and updated these two store procedure and view in that sequence? or should I create SQL Server Agent job with command to update stored procedure 1 then I need to create another job with command to update view and then create another job with command to stored procedure 2.

Thank you for any suggestions.

1

There are 1 answers

0
Eduard Uta On

Yes, the tasks that are described in the question can be done with one single SQL Server Agent Job.
For this SQL Server Agent Job you may want to set several steps
- Step 1: run SP1
- Step 2: update view
- Step 3: run SP2)
OR actually create only one step that will have all the actions inside. Also, the job should have the 3 months schedule created as needed.
Note: you refer as "update stored procedure 1" .. I think you actually mean "execute stored procedure 1".

For further documentation I recommend: http://msdn.microsoft.com/en-us/library/ms190268(v=sql.105).aspx