Showing posts with label Msdb. Show all posts
Showing posts with label Msdb. Show all posts

Job last run information

Use msdb
Go

Declare @job_id UniqueIdentifier
Select @job_id = Job_Id from sysjobs Where name='Job Name'
EXEC sp_help_jobserver @job_id = @job_id, @show_last_run_details = 1
Go

To fetch SQL Agent JOBs Info.,

To fetch SQL JOBs' information from the current Instance

Use Master
Go
 

EXECUTE msdb.dbo.sp_sqlagent_refresh_job
Go