SQL Agent Job ->> 通过sys.sysprocesses的program_name字段来定位对应的Job

时间:2022-03-28 15:11:45
;WITH T AS (
SELECT
'SQLAgent - TSQL JobStep (Job 0x'+
CONVERT(char(32),CAST(j.job_id AS binary(16)),2) +
' : Step ' +
CAST(js.step_id AS VARCHAR(3)) +
')' filter, j.job_id, j.name
FROM msdb.dbo.sysjobs AS j
INNER JOIN msdb.dbo.sysjobsteps AS js
ON j.job_id = js.job_id) SELECT * FROM T WHERE filter = 'SQLAgent - TSQL JobStep (Job 0x25B753B44782D94AB4D4264B7A6386B4 : Step 1)'