Comment arrêter un job en cours ?

0
74
How to kill a sql server agent running job?
How to check how many jobs are currently running?

Listing the currently running jobs:

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

Stopping a job:

USE msdb
GO
EXEC dbo.sp_stop_job
N’The name of the job’

LEAVE A REPLY

Please enter your comment!
Please enter your name here