added files from swmgmt03

This commit is contained in:
Schork Thierry (Galenica - ADM)
2025-09-22 09:00:00 +02:00
parent de97031b1e
commit 63d058a7eb
67 changed files with 13300 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
DECLARE @tpl VARCHAR(255)='exec msdb.dbo.sp_start_job @job_name= ''@job@''; '+CHAR(13)+CHAR(10)
DECLARE @q VARCHAR(MAX)='';
SELECT @q = @q + REPLACE(@tpl, '@job@', j.name)
FROM msdb.dbo.sysjobs j
WHERE name LIKE 'ActivePosTran distribution agent -%'
AND NOT EXISTS(
--the job is currently running
SELECT 1
FROM msdb.dbo.sysjobactivity sja
WHERE sja.job_id = j.job_id
AND sja.start_execution_date IS NOT NULL
AND sja.stop_execution_date IS NULL
)
IF @q <> ''
BEGIN
PRINT @q
EXEC(@q)
END