SQL Agent Start Time

  • Hi Experts,

    Could you please provide me some inputs on how to get sql agent service start up time.

    Thanks in advance.

  • chinna.sp3025 - Friday, May 12, 2017 1:20 AM

    Hi Experts,

    Could you please provide me some inputs on how to get sql agent service start up time.

    Thanks in advance.

    If you have the relevant permissions then:
    SELECT *
    FROM  sys.dm_server_services
    WHERE
    ServiceName LIKE 'SQL Server Agent%'


    I'm on LinkedIn

  • PB_BI - Friday, May 12, 2017 1:26 AM

    chinna.sp3025 - Friday, May 12, 2017 1:20 AM

    Hi Experts,

    Could you please provide me some inputs on how to get sql agent service start up time.

    Thanks in advance.

    If you have the relevant permissions then:
    SELECT *
    FROM  sys.dm_server_services
    WHERE
    ServiceName LIKE 'SQL Server Agent%'

    Thank you for the reply.

    Last_startup_time showing as Null , any info on this ?

    Thanks in advace.

  • chinna.sp3025 - Friday, May 12, 2017 3:27 AM

    PB_BI - Friday, May 12, 2017 1:26 AM

    chinna.sp3025 - Friday, May 12, 2017 1:20 AM

    Hi Experts,

    Could you please provide me some inputs on how to get sql agent service start up time.

    Thanks in advance.

    If you have the relevant permissions then:
    SELECT *
    FROM  sys.dm_server_services
    WHERE
    ServiceName LIKE 'SQL Server Agent%'

    Thank you for the reply.

    Last_startup_time showing as Null , any info on this ?

    Thanks in advace.

    I think it was a bug in certain earlier versions, but since you have posted in the 2016 forum I thought that it would work.

    Try this:
    SELECT program_name, login_time

    FROM sys.sysprocesses

    WHERE program_name = 'SQLAgent - Generic Refresher'


    I'm on LinkedIn

  • another way would be to look for agent startup in eventlog. here is a way to parse the log with powershell.
    get-eventlog -logname system -source "service control manager" -message "*SQL Server Agent*running*"

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Please use below command to read the agent start time from Agent Error Log.

    EXEC master.dbo.xp_readerrorlog 0, 2, "SQLSERVERAGENT starting under"

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

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