Posts Tagged ‘Finding Stored Procedure Name or Command text used by SQL server Job’

There may be probability that we have hundreds of SQL Server’s Jobs scheduled to run every day on a SQL Server instance.  Here is a script to find quickly the stored procedure or command text used by SQL Server’s Job.

Select JB.Name [Job Name], JBSTP.Command [Command Text] from MSDB.dbo.Sysjobs JB
INNER JOIN MSDB.dbo.sysjobsteps JBSTP on JB.Job_ID = JBSTP.Job_ID
where JBSTP.Command Like   ‘%SP or Command Name%’