Find if a stored procedure is used in any job

SELECT j.name
  FROM msdb.dbo.sysjobs AS j
  WHERE EXISTS
  (
    SELECT 1 FROM msdb.dbo.sysjobsteps AS s
      WHERE s.job_id = j.job_id
      AND s.command LIKE '%%'
  );

Comments

Popular posts from this blog

Search column names in database

Typing Speed Test