Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if SQL Server Agent is running

I am using SQL Server 2008 r2. I want to find a way to verify if SQL Server Agent is running. I am suspicious that the Agent isn't running, but I don't know how to check.

like image 818
qinking126 Avatar asked Jul 24 '12 14:07

qinking126


People also ask

How can I tell if SQL Server Agent is stopped?

When SQL Serer stopped, There will be an information type Event ID 17148 (SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only.

How do I find SQL Server SQL Server Agent?

To configure SQL Server AgentSelect the Start button, and then, on the Start menu, select Control Panel. In Control Panel, select System and Security, select Administrative Tools, and then select Local Security Policy.


1 Answers

In Management Studio, you can check if SQL Server Agent is running by looking at the SQL Server Agent node in Object Explorer. In the following screen shot, SQL Server Agent on my SQL Server 2012 instance is running (green arrow overlaid on the SQL Server Agent icon), but the agent for SQL Server 2000 is stopped (red x).

enter image description here

You can also check in Control Panel > Administrative Tools > Services:

enter image description here

Or in Program Files > Microsoft SQL Server > Configuration Tools > Configuration Manager:

enter image description here

Finally, you can check the state using T-SQL:

DECLARE @agent NVARCHAR(512);

SELECT @agent = COALESCE(N'SQLAgent$' + CONVERT(SYSNAME, SERVERPROPERTY('InstanceName')), 
  N'SQLServerAgent');

EXEC master.dbo.xp_servicecontrol 'QueryState', @agent;
like image 182
Aaron Bertrand Avatar answered Oct 10 '22 02:10

Aaron Bertrand