Schedule task in sql server 2008

  • hi all

    please help me out to get the execution time of Scheduled task in sql server.i want to get time in seconds like hh:mm:ss .

    Thanks

    selva

    --------------------------------------------------------

    I am Learner -- SQL

  • The MSDB database will contain what you need especially the run duration column in sysjobhistory which is in seconds, then you just need to format it how you want it formatting.

  • FYI: The column is called run_time and you will have to jump through hoops to get it formated the way you want it. Not only does it count hours in Zulu time, but it drops leading zeros.

    So, IIRC, 54820 is 5:48.20 a.m. and 164820 is 4:48.20 p.m.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Ah, now the question raises, is it the OP refering to execution time as the time the job started, or the length of time the job took to complete?

    I took it as execution time = time the job took to complete, hence the run_duration column, but if it is the start time of the schedule then yes run_time is the column to look at.

  • That is a good point, Anthony. We were reading that question two different ways.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply