SQL Repository
  • Home
  • Articles
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • Code Snippets
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • Interview Questions
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • How To
    • MS SQL DBA
    • SSIS
    • SSRS
    • T-SQL
  • Contact





Find the modified date of SQL Server Agents Jobs

On 06 May, 2015
T-SQL
By : Dave Jenkins
No Comments
Views : 10623

Earlier on today I really needed to see the last modified date of a job that had been disabled. I didn’t know whether it was recent change or whether it was in the distant past. SQL Server Agent Job screen doesn’t have a ‘last modified’ column, so where did I turn to?


The SYSJOBS in the MSDB. Running the following code against it will bring back all the information we need. The start date is to narrow down data returned, you could remove it if you wish:

Last modified date of SQL Server jobs
Transact-SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
USE msdb;
GO
 
DECLARE @SearchDate DATETIME;
SET @SearchDate = '01 JAN 2015'
 
SELECT
       name,
       [enabled],
       date_created,
       date_modified
FROM
       sysjobs
WHERE
       date_modified >= @SearchDate AND
       enabled = 0
ORDER BY
       date_modified DESC;
GO

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Google+ (Opens in new window)

Related



Tags :   JobsSQL Server AgentT-SQL

Previous Post Next Post 

About The Author

Dave Jenkins

Hello! I'm Dave Jenkins and I have been working with MS SQL Server for two years. I'm an MCP (70-461) working towards an MCSA. I love working with MS SQL Server and the BI Stack.


Number of Posts : 26
All Posts by : Dave Jenkins

Related Posts

  • 70-461 Querying Microsoft SQL Server 2012

  • ANY, SOME and ALL

  • Dynamic date range based on todays date

  • Last Modified date of SQL Server Agent Job schedules

Leave a Comment

Click here to cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">





  • Popular
  • Recent
  • Database stuck in “Restoring” state

    19579 views
  • Find the modified date of SQL Server Agents Jobs

    10623 views
  • Script to Check TempDB Speed

    5651 views
  • PING all the Linked Servers and get a status report

    5317 views
  • Log shipping Alerts failing to send emails

    5046 views
  • Moving the tempdb database

    27 Jan, 2016
  • Script to Check TempDB Speed

    14 Jan, 2016
  • SQL Server buffer pool

    05 Nov, 2015
  • Log shipping Alerts failing to send emails

    04 Nov, 2015
  • View queries waiting for memory grant

    21 Oct, 2015

Useful links

  • Books Online for SQL Server 2012
  • Developer Reference for SQL Server 2014
  • Download SQL Server
  • Installation for SQL Server 2012
  • Microsoft Virtual Academy
  • SQL Server Online Training
  • Transact-SQL Reference
  • Tutorials for SQL Server 2012

Tags

.CSV 70-461 AdventureWorks 2012 ALL ANY CAST Chinook Database Code Snippet CONVERT CTE dataset datasource Dates DATETIME divide by zero Duplicates Exam EXCEPT expressions FORMAT IF Import Indexes INTERSECT Jobs NULLIF REBUILD Recursive CTE REORGANIZE ROW_NUMBER() Schedules Sequence SOME sp_stop_job SQL Server 2012 SQL Server Agent SSIS SSRS T-SQL Tally Table T_SQL UAC Permissions Error UNION UNION ALL

Recent Comments

  • Rudnei Silva on Log shipping Alerts failing to send emails
  • johnson Welch on Database stuck in “Restoring” state
  • Neil on Database stuck in “Restoring” state
  • Mark Gribler on MS SQL Database Administrator Interview Questions – Part 4

Google Analytics Stats

Latest Tweets:

  • 7 years ago Attended @SQLSatMcr yesterday - it was amazing! Roll on @sqlsatcambs! Won some Beats Headphones courtesy of @SQLDBApros - thanks guys! :)
  • 7 years ago Looking forward to attending @SQLSatMcr - its too far off though!!!
  • 7 years ago Simple Post: WhoIsActive SPROC: http://t.co/LZvQUaeapK
  • 7 years ago POST: Index REBUILD or Index REORGANIZE: http://t.co/h3L0N37vw4
  • 7 years ago How to Ping all Linked Servers: http://t.co/Q2QxusrKjO
  • 7 years ago For beginners - T-SQL Divide by Zero Error: http://t.co/BBhgoH5hK9

© Copyright 2015 SQL Repository. All Rights Reserved by SQL Repository