El TecnoBaúl de Kiquenet

Kiquenet boring stories

Scheduled Tasks

Posted by kiquenet en 24 junio 2014

Task Scheduler – Automated Emails – Windows Service – SendEmail.exe

http://yoursandmyideas.wordpress.com/2012/01/07/task-scheduler-in-c-net/
http://www.codeproject.com/Articles/2407/A-New-Task-Scheduler-Class-Library-for-NET

http://www.makeuseof.com/tag/send-automated-emails-save-time-sendemail-windows-task-scheduler/
http://www.howtogeek.com/125045/how-to-easily-send-emails-from-the-windows-task-scheduler/

http://www.intstrings.com/ramivemula/articles/sending-automated-emails-asynchronously-using-a-c-windows-service-in-conjunction-with-database-email-records-part-ii/
http://ruchitech.blogspot.com.es/2012/06/sending-automated-emails-using-c.html
http://fairwaytech.com/2013/06/simple-scheduled-task-runner/

http://stackoverflow.com/questions/18858512/c-sharp-console-app-to-send-email-at-scheduled-times

Quartz Enterprise Scheduler.NET

http://quartznet.sourceforge.net/

Conversion Date – SqlServer
http://stackoverflow.com/questions/207190/sql-server-string-to-date-conversion

SqlServerCrontab (NContrab)

https://code.google.com/p/ncrontab/wiki/SqlServerCrontab

In Sql Server (Jobs)

USE msdb
GO

SELECT TOP 3
    sj.job_id                 AS JobId,
    sj.name                   AS JobName,
    run_date                  AS RunDate,
    run_time                  AS Runtime,
    run_duration              AS RunDuration,
    CAST(
        CONVERT(CHAR(8), run_date, 112) + ‘ ‘ +
        STUFF(STUFF(RIGHT(‘000000’ + CONVERT(VARCHAR(8), run_time), 6), 5, 0, ‘:’), 3, 0, ‘:’)
        AS DateTime)              AS StartedAt,                   
    (CONVERT (VARCHAR,
        (DATEADD(ss,
            (CASE LEN(run_duration)
                WHEN 1
                THEN run_duration
                WHEN 2
                THEN run_duration
                WHEN 3
                THEN (CAST(Left(right(run_duration,3),1) as int)*60)
                    + (right(run_duration,2))
                WHEN 4
                THEN (CAST(Left(right(run_duration,4),2) AS int)*60)
                    + (right(run_duration,2))
                WHEN 5
                THEN (CAST(Left(right(run_duration,5),1) AS int)*3600)
                    + (CAST(Left(right(run_duration,4),2) AS int)*60)
                    + right(run_duration,2)
                WHEN 6
                THEN (CAST(Left(right(run_duration,6),2) AS int)*3600)
                    + (CAST(Left(right(run_duration,4),2) AS int)*60)
                    + right(run_duration,2)
              END ),
            CAST(
                CONVERT(CHAR(8), run_date, 112) + ‘ ‘ +
                STUFF(STUFF(RIGHT(‘000000’ + CONVERT(VARCHAR(8), run_time), 6), 5, 0, ‘:’), 3, 0, ‘:’)
            AS DateTime)))
        ,120))                    AS CompletedAt 
    FROM   msdb.dbo.sysjobhistory sjh WITH (nolock)
        INNER JOIN msdb.dbo.sysjobs sj WITH (nolock)
               ON sjh.job_id = sj.job_id
WHERE  sjh.step_id = 0
ORDER  BY run_date DESC,
          run_time DESC

 

References:

http://beyondrelational.com/modules/2/blogs/88/Posts/19361/when-exactly-scheduled-jobs-started-and-completed-sql-server.aspx

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

 
A %d blogueros les gusta esto: