I execute
EXEC msdb.dbo.sp_start_job N'myjob'
for start my job then after in a loop i execute
EXEC msdb.dbo.sp_help_job @job_name = N'myjob'
then this return 4 tables, in first table I took
current_execution_status
then if this is equals to
1,2 or 3 I considerate this is Executing but if this is diferent to these values I considerate this has finished (maybe it failed or it finished correctly, but it has finished) then as this has finished I start the process again .......
EXEC msdb.dbo.sp_start_job N'myjob'
but after a time (this works good some time (variable time) and after I got
the job myjob is already running from a request by user ...
I believe my error is considerating values (1,2,3) with current_execution_status
maybe i need considerate more values, is not it?
what values?
is there a best way? or a easier way? thanks