END
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
IF (@@TRANCOUNT > 0) BEGIN
ROLLBACK TRANSACTION
RETURN 1
END
EndSave:
--star the job immediately
EXEC @ReturnCode = msdb.dbo.sp_start_job @job_id = @JobID
--return to the invoker immediately
RETURN @ReturnCode
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
文章来源于领测软件测试网 https://www.ltesting.net/