adminbd

Записи по mssql,oracle,windows и linux

Have a Question?

If you have any question you can ask below or enter what you are looking for!

Показывает все задания в mssql с датой выполнения и вывести список заданий (fob) в sql

/************************************************************
 *  * k.moskvichev ©
 * Time: 10.12.2015 14:07:36
 ************************************************************/

USE msdb

SELECT 		
			DISTINCT
			TOP 100
			--a.job_id  AS Id
           a.name    AS NAME_job
           ,MAX(b.run_date),
            max(b.run_time)
            --  b.step_id,
            --,b.run_status
            
            --SELECT *
FROM   
			dbo.sysjobs a
FULL OUTER JOIN 
	   		dbo.sysjobhistory b
            ON  a.job_id = b.job_id
AND         
			a.[enabled] = '1'
			--WHERE
GROUP BY
       		--b.run_date, 
       		a.job_id
           ,a.name --a.job_id,a.name,b.step_id,b.run_status
ORDER BY
       		a.name       DESC
       		--  b.run_time  DESC
select * FROM [msdb].[dbo].[sysjobs]

 

Leave a Reply

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

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>