SQL Server Agent Status...

  • Hi All

    We are currently doing daily checklists on all our servers and one of them includes; to check wether the SQL Agent is running.

    In Enterprise Manager, a green arrow represents an active SQL Agent. In Management Studio, you click the server's properties to view the status.

    My question to you is; if there's no green arrow and no info is given in the servers' properties window, is there another way to check if the SQL Agent is running?

    Any help would be GREAT

    Thanks

    Anche

  • Anchelin,

    Here is one of the ways to know the state of ther service...

    EXEC master.dbo.xp_ServiceControl 'QUERYSTATE','SQLServerAgent'

    Keep in mind that xp_ServiceControl is undocumented and unsupported as its behavior could change with a service pack or the next release of SQL Server. If this is a concern, you can consider using msdb.dbo.sp_start_job.

    --Ramesh


  • You can also check under the Services console, where you can view both the Agent and SQL Server services:

    1. Right click on My Computer

    2. Click on Manage

    3. Open up Services and Applications

    4. Click on Services - scroll down to SQL Server Agent and view the status column to see if its running. You can do that from any PC by "connecting" to it from the Computer Management console.

  • Hi Nali

    I need to see the status of Agent within SQLServer for a current server.

    Anchelin

  • This works with SQL Server 7, 2000, and 2005:

    if exists ( select * from master.dbo.sysprocesses where  program_name like 'SQLAgent%')
    begin print 'SQL Agent running' end else begin print 'SQL Agent not running' end
     
  • Hi

    Thank you very much!!!Exactly what I needed. Again;THANKS!!!:

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

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