I have a stored procedure USP_A
with logic like following:
......
exec dbo.usp_Log 'Start to run job job1'
Exec @intErrorCode = msdb.dbo.sp_start_job 'job1'
IF @intErrorCode <> 0 Goto errorHandling
exec dbo.usp_Log 'End to run job job1'
......
But when I run this stored procedure, it got stuck and when I check log I can only see message 'Start to run job job1'. Also in the SQL Server Agent job monitor I can not see this job get triggered.
But if I manually run
Exec @intErrorCode = msdb.dbo.sp_start_job 'job1'
it works fine.
The SQL Server is Microsoft SQL Server 2005 Enterprise Edition (version 9.00.5000.00)