question

nandhinir avatar image
nandhinir asked

SQL job sp not getting executed

Hi, I have created a sql job. It is getting executed successfully. But stored procedure is not getting executed in the job. If I run stored procedure seperately values are getting updated accordingly. Any idea about the job behaviour?
jobsjob failure
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Are the stored procedures not getting executed, or are they not producing the result you wish? You can have a look in SQL Profiler, while running the job, to see what is going on.
0 Likes 0 ·

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
Is there more than one step in the job? If so you may have it exiting before it gets to your step. Check the second page of properties of each step to ensure that it goes on to the next step on successful completion. It could also be a question of permissions. Your SQL Agent service runs under an account that is different than yours, so it may not be able to modify the database. Also, you can adjust the output of the job steps to write to a file so you can see all the information from the job. That's a good way to understand how things run. As @Magnus says in the comment, you can also use trace events or extended events to observe the system as the job runs.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you... I have changed the "On Success Option: Go to next step". Now its working fine.
0 Likes 0 ·
Good to hear @nandhinir. The site runs on votes, so if this answer was helpful, please click the thumbs up. If the answer solved your problem, also click on the check mark.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.