Is there any way to search and find ,what job holds a particular table refresh . There are multiple sql agent jobs with multiple steps.What is the sql query to search all jobs and locate the job name and steps?
This is to identify the steps associated with a table load
Take a look at this:
use msdb
SELECT
[sJOB].[job_id] AS [JobID]
, [sJOB].[name] AS [JobName]
,step.step_name
,step.command
FROM
[msdb].[dbo].[sysjobs] AS [sJOB]
LEFT JOIN [msdb].dbo.sysjobsteps step ON sJOB.job_id = step.job_id
WHERE step.command LIKE '%MYTABLENAME%'
ORDER BY [JobName]