Monday, March 17, 2008

SQL Server Agent Jobs duration Report

Hi folks. I would like to share with you the following simple script to show us jobs duration report in SQL Server 2005. I manipulated with INTERGER values stored by SQL Server to convert them into DATETIME/CHAR(8) datatypes to represent the data.
Thanks to SQL Server MVP Peter Ward provided me with StartTime calculation.

WITH job_duration_view
AS
(
SELECT name,
StartTime = CONVERT(DATETIME, RTRIM(last_run_date)) +
(last_run_time * 9 + last_run_time % 10000 * 6 + last_run_time % 100 * 10 + 25 * last_run_duration) / 216e4 ,
CONVERT(CHAR(8),DATEADD(ss,last_run_duration,CAST(last_run_date AS CHAR(8))),114)
AS duration
FROM msdb.dbo.sysjobservers js
JOIN msdb.dbo.sysjobs j ON j.job_id = js.job_id
WHERE last_run_date >0 AND last_run_time >0
) SELECT name AS job_name,StartTime,
StartTime -'19000101'+Duration AS EndDate ,Duration
FROM job_duration_view

35 comments:

Anonymous said...

Hello I just entered before I have to leave to the airport, it's been very nice to meet you, if you want here is the site I told you about where I type some stuff and make good money (I work from home): here it is

Unknown said...

I would like to become a SQL Developer. What would be one of the first steps I would need to do in pursuing this as a career? I do not know SQL programming very well.

Anonymous said...

Delivering a new dimension for hardcore Maple Story players with the addition of a fourth job and some free maple mesos, this is launched today. Maple Story players will have reached a high enough level to achieve the 4th Job or some necessary maplestory mesos, which begins this week. Many people can cost their own cheap mesos to gain themed dessert and costumes among their many posts. The addition of the 4th Job provides further depth to an already intricate and complex maple story mesos in game. At Leafre, players can find new upgrades for some of the games more powerful weapons can receive from mesos and also party with other elite players.

Anonymous said...

China Wholesale has been described as the world’s factory. This phenomenom is typified by the rise ofbusiness. Incredible range of products available with China Wholesalers “Low Price and High Quality” not only reaches directly to their target clients worldwide but also ensures that wholesale from china from China means margins you cannot find elsewhere and buy products wholesaleChina Wholesale will skyroket your profits.wedding dressescheap naruto cosplayanime cosplay

Anonymous said...

Women’s nike tn Shox Rivalry est le modèle féminin le plus tendance de baskets pour le sport. tn chaussuresConcernant la semelle :spyder jacketsCheap Brand Jeans Shop - True Religion Jeans cheap nike shox & Puma Shoes Online- tn nike,Diesel Jeans le caoutchouc extérieur, l’EVA intermédiaire Levis Jeanset le textile intérieur s’associent pour attribuer à la.ed hardy shirts pretty fitCharlestoncheap columbia jackets. turned a pair of double plays to do the trick.Lacoste Polo Shirts, puma basket, Burberry Polo Shirts.wholesale Lacoste polo shirts and cheap polo shirtswith great price.Thank you so much!!cheap polo shirts men'ssweate,gillette mach3 razor bladesfor men.As for Cheap Evisu JeansCheap Armani Jeanspolo shirtsPuma shoes

men's clothing said...

I feel honored and privileged after reading your posts.You know,summer is coming!
hommes chaussures
Chaussures Homme Nike,hommes chaussures pas cher.fashionable homme chaussure,Best wishes to you!
Acheter hommes chaussures in our shop

aiya said...

Office 2010is powerful!
Microsoft Office 2010is the best software in the world.
Microsoft wordis so great!
Office 2007makes life great!
Many people likeMicrosoft Office.
Microsoft Office 2007is welcomed by the whole world.
Office 2007 keyis available here.
Office 2007 downloadis on sale now!
Office 2007 Professionalbring me so much convenience.
Outlook 2010 make life wonderful!
Microsoft outlook is my love.
Microsoft outlook 2010 is convenient!
Windows 7 is convenient!

Unknown said...

Nice news and thanks for sharing this here to let me know this updates,please know the recent updates by visiting this link also…because I had gain some info from here also: SQL Server Jobs

Unknown said...

looking for jobs?? Visit this site.. It might help
Jobs

Unknown said...

This is a great article. It gave me a lot of useful information. thank you very much.
Signature:
Jugar juegos de frozen en línea gratis, los nuevos de princesa de Disney juego frozen - la princesa encantadora y linda. Divertirse frozen!

Unknown said...

Thank you for that information you article.
Signature:
download descargar facebook gratis para Android celular and download free descargar facebook apk en español, descargar facebook plus , descarga facebook

Unknown said...

Great info. I love all the posts, I really enjoyed, I would like more information about this, because it is very nice., Thanks for sharing.
Signature:
download free descargar whatsapp gratis and download baixar whatsapp gratis online and descargar whatsapp , baixar whatsapp

Unknown said...

I understand what you bring it very meaningful and useful, thanks.
Signature:
Versión en facebook en español descargar a los países hablan Español: facebook entrar direto agora , facebook en español para and facebook entrar direto

Unknown said...

great article, I was very impressed about it, wish you would have stayed next share
kids games online
friv 2
unblocked games 77
juego de un show mas

Unknown said...

You topic is very great and useful for us…thank you
juegosjuegos.com
juegos de matar zombies
jogos do friv

Sophie Grace said...

It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing.If you want to find idol's account on instagram, please visit instagram story viewer

Unknown said...

Online Betting in India

Online Games said...

There are a few things you can remember before selecting the right sportsbook for your betting style. First, check if the bookmaker is approved by one of the trusted agencies.
https://gervaisjervis9.wixsite.com/tooltech/post/betting-advice-and-cricket-match-forecasts-for-cricket

Online Games said...

Cricket betting india is one of the most sophisticated website that provides all kinds of betting tips that are free to access. That will not only help you right now but also beneficial in your long run.
https://collegeplus.itri.org.tw/forums/users/cricket_betting/

https://www.theartfulhomedomain.com/site/bestofbettingsites.com said...

I've read a few of the blog posts on your website now, and I really like your blogging style. I've saved it to my bookmark website list and will return soon. Please visit my website and let me know what you think.

https://www.cordylink.com/site/bestofbettingsites.com

https://www.cordylink.com/site/bestofbettingsites.com

Ashish said...

All of the safest betting websites have a license issued by a legit gambling commission and that’s the first thing we establish. The regulators run extensive background checks before they grant the necessary seal of approval and they continue monitoring their trusted bookmakers after that.
https://my-blogging-channel-15.webself.net/blog/2021/03/10/workings-of-licensed-online-cricket-betting-sites-in-india

Online Games said...

On Cricket betting india we provide you with the most up-to-date information on cricket betting in India.
https://fileforum.com/profile/cricketbettingindia

Sean Martin said...

I've read a few of your blog posts now, and I really like your writing style. Your subject is fantastic and extremely beneficial to us. https://www.digi.com/support/forum/user/narantour

Ashish said...

betfair 365 is an online betting website that offers a variety of guidelines and free betting tips that prove to be very useful for people just entering betting. It is among the top websites for betting in India.
https://my.desktopnexus.com/Lookinindia123/

Ashish Mehta said...

famous female boxers are becoming the most significant way to practice betting and more people are joining online betting websites daily. These websites suit these online betters as they provide them with the best services.
https://www.teachertube.com/user/channel/muneercars123

Restaurants Menu and Guide said...

Thank you for providing such a wonderful website; it has been quite beneficial to me. Continue to write. Thank you kindly. I'm pleased to say that your post was a pleasure to read. I'm never going to stop talking about it. You're doing a fantastic job. https://www.behance.net/emailmarketing3

Unknown said...

Thank you for providing such a wonderful website; it has been quite beneficial to me. Continue to write. Thank you kindly. I'm pleased to say that your post was a pleasure to read. I'm never going to stop talking about it. You're doing a fantastic job. https://www.cybo.com/US-biz/mobile-windscreen


N.S Kehal said...

Looking for such informative post.
https://foldads.com/0/posts/3-Services/20-Financial/384098-Accountant-Surrey-BC.html

Unknown said...

I've read a few of your blog posts and really enjoy your your style. Your topic is wonderful and incredibly useful to us. https://www.bakespace.com/members/profile/summersale/1306652/

Ashish Mehta said...

The joy of masturbation is a mystery waiting to be explored in the human psyche for any beginner. For others, it may be a humiliating experience, while others will be perplexed by the overwhelming urge to orgasm.
https://pleasureden-aus.tumblr.com/post/642984034736177152/restraints

Ashish Mehta said...

Find online sweatshirts, Jogger sets and hoodies for kids and boys at a fair price. Free shipping available on Anthrilo
https://classifieds4free.biz/0/posts/5-For-Sale/35-Clothing-Shoes-Accessories/1732517-Online-Shopping-for-Kids.html

AWS Mortgages said...

We know that getting a large mortgage as a professional can be very challenging. The AWS Mortgages consulting system allows you to identify the pros and cons of various large mortgage Loans and the competitive interest rates offered by large mortgage lenders.
https://amazingviralmagzine.com/tips-for-choosing-a-mortgage-for-a-first-time-homebuyer/

N.S Kehal said...

Now invest your precious energy and time in doing administrative tasks as we outsource bookkeeping for small business firms that will help you in this regard. Find expert accounting outsourcing services for small businesses along with other services from us.
https://www.divephotoguide.com/user/kehalcpa

Ashish Mehta said...

Get out (dont stroll!) to discover the latest fashions in jeans for men. Explore boys joggers in an array of trendy colours, camo styles and cargo pants, too. The boys joggers we offer pair well with a basic shirt or the latest design he's is adoring!
https://www.scoop.it/topic/kids-clothes-by-anthrilo/p/4128310238/2021/11/18/girls-shorts-sets-anthrilo

Ashish Mehta said...

Remortgage to contractors involves the process of underwriting, registering, documenting, and providing information that can be complex and difficult for contractors. But with the advice of a specialised contractor remortgage's broker, this process will be done for you in the shortest possible time and with high quality. Meantime, access to contracts at favourable rates is one of the advantages of using a contractor remortgage's broker. AWS Mortgage specialist advisors are ready to help you with all the processes and documents required to get a mortgage again. AWS Mortgage advisors having experience in doing several cases will advise contractors from the beginning to the end.
https://articlescad.com/what-is-a-contractor-mortgage-broker-and-do-i-need-one-19983.html