You are troubleshooting SQL Server Agent jobs on a SQL Server instance by using Transact-SQL.
Complete the sentence by selecting the correct option for each blank.
To return details about one specific SQL Server Agent job, use . To list the ID and name of every SQL Server Agent job on the instance, use .
- Blank 1: a call to sp_help_job (correct answer)
sp_help_job provides information about a specific SQL Server Agent job. sp_start_job starts a job rather than reporting its details. jobs.job_executions provides execution information for Elastic Jobs, not SQL Server Agent jobs.
- Blank 2: a query against msdb.dbo.sysjobs (correct answer)
Querying dbo.sysjobs in msdb returns SQL Server Agent job IDs and names. sp_start_job starts a job rather than listing jobs. jobs.job_executions reports Elastic Jobs executions rather than SQL Server Agent job definitions.
Use sp_help_job when investigating an individual SQL Server Agent job. To list the jobs defined on the instance, select job_id and name from msdb.dbo.sysjobs. The jobs.job_executions view serves Elastic Jobs monitoring instead.
- SQL Server AgentMicrosoft Learn
- Manage Azure PaaS tasks using automation: Monitor automated tasksMicrosoft Learn