December 4, 2006 at 8:07 am
Hi,
I have created a SP to schedule the JOB with 2 steps
Job Name:Report queue
step 1.run SP(application specific)
with goto next on successfull and fail
step 2.Delete job( report queue)
quit with success or fail
when executed this job manually its running fine(step1 and step2),but
When I executed it by another small SP to run this job(Report queue),
step1 is executing successfully,but not executing step2
(on success or fail it is not executing step2)
please suggest ,It is very urgent
thanks in advance
December 4, 2006 at 9:05 am
Any Errors?
We need more information to help figure out.
December 4, 2006 at 9:30 am
No errors,found
step1 is faling or succeding and quiting
December 4, 2006 at 12:12 pm
I believe you are using sp_delete_job job in step to delete "report queue" job in step2.
Does user who is executing the another procedure to run report queue job has the access to delete the jobs?
MohammedU
Microsoft SQL Server MVP
December 6, 2006 at 1:24 am
Job '{FE60D42E-C71E-4E32-8C5C-A44640E09B82}' :
Step 1, 'run sp' : Began Executing 2006-12-06 08:09:16
[SQLSTATE 01000]
Job '{FE60D42E-C71E-4E32-8C5C-A44640E09B82}' :
Step 2, 'Delete job' : Began Executing 2006-12-06 08:11:25
Msg 0, Sev 0: Operation canceled [SQLSTATE HY008]
Query cancelled.
using sp_delete_job:
database user with memebre of dbo,
I will change it to sa and let me se.
is the users belong to dbo can delete the jobs
December 6, 2006 at 5:39 am
even with SA also its endinga t step1
December 6, 2006 at 11:19 am
If you are stopping the running job it reports as cancelled ("The step was cancelled (stopped) as the result of a stop job request. ") not success.
It is reporting as it suppose to... there is nothing wrong...
MohammedU
Microsoft SQL Server MVP
December 7, 2006 at 9:08 am
Mohammed
Its reporting as step1 successfull and when I look at SQLAgent error log,
found
1.[162] Internal request (from SetJobNextRunDate [reason: schedule will not run again]) to deactivate schedule 2171
2.[180] Job P226862006100301223 was deleted while it was executing: the outcome was (Unknown)
(step1 executes the job P22----1223 job and step2 deletes it)
when I tried to delete it manually its giving below error
2006-12-01 10:03:22 - + [000] Job 0xCAB3373D8690FE49B36074687327CC44 does not exist in the job cache
pl suggest
December 7, 2006 at 12:25 pm
Sorry!
I misread your procedure name... I thought you are using sp_stop_job...
You are using sp_delete_job which deletes the job from the system.
When you are in EM and selected that job you will see the job even after the job ran but when you try to see the history that table information deleted from sysjobs table so it says job doesn't exists... it is true..
If you want to stop the use sp_stop_job...
Job deleted means gone everything there is not cache nothing unless you restore previous backup of MSDB...
MohammedU
Microsoft SQL Server MVP
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply