Link: https://www.sqlservercentral.com/Forums/Topic1156549-391-1.aspx
/* Erkennen ob ein Agent Job noch läuft und diesen ggf. auch abbrechen.... Link: https://www.sqlservercentral.com/Forums/Topic1156549-391-1.aspx */ SELECT [sjv].[name], [sjv].[description], [sja].[run_requested_date], [sja].[last_executed_step_id] FROM [msdb].[dbo].[sysjobs_view] sjv JOIN [msdb].[dbo].[sysjobactivity] sja ON [sjv].[job_id] = [sja].[job_id] WHERE [sja].[run_requested_date] is not null AND [sja].[stop_execution_date] is null USE msdb GO --EXEC dbo.sp_stop_job N'....hier den namen des Jobs...'