우리가 관리하고 있는 JOB들의 상세 내역을 확인하는 쿼리 이다.


SELECT A.NAME, B.NEXT_RUN_DATE, B.NEXT_RUN_TIME, C.LAST_RUN_DATE, C.LAST_RUN_TIME, C.LAST_RUN_DURATION, C.COMMAND

FROM   MSDB.DBO.SYSJOBS A WITH (NOLOCK)

      ,MSDB.DBO.SYSJOBSCHEDULES B WITH (NOLOCK)

      ,MSDB.DBO.SYSJOBSTEPS C WITH (NOLOCK)

WHERE  A.JOB_ID = B.JOB_ID

AND    B.JOB_ID = C.JOB_ID

AND    A.ENABLED = 1

ORDER BY B.NEXT_RUN_TIME, A.NAME



+ Recent posts