Advertisement

Checking SQL Server Job History by Script

Share the blog:

Checking SQL Server Job History by Script

Mainly msdb.dbo.sysjobs and msdb.dbo.sysjobhistory contains all major information regarding the SQL Server job and its running status and history. We may directly query both objects and get the details or we may use SSMS and view agent job history.

Solution

Here is a simple TSQL to simplify the work:

Query

Steps

To run a script on a Microsoft SQL Server using SSMS.

  • Open Microsoft SQL Server Management Studio
  • Select [New Query] from the toolbar
  • Copy the ‘Example Query’
  • Select the database to run the query against
  • Paste the ‘Example Query’ into the query window
  • Click the [Execute] button

Result

Facebook Comments Box
Share the blog:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisement