Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Is SQL Agent Running?

Author  Topic 

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2008-04-24 : 14:28:48
Hello everyone,
I recently ran across with a request to check if the SQL Server Agent is running on all the servers, I immediately thought about implementing that with SSIS, since I've accomplished such repetitive task before with using SSIS.
However, I'm unsure on how to do it, my first approach was creating a script that would create a table with all services running on the machine using the DOS "SC" command, now, I don't think that's going to do what I need, since it'll only give me a list with all the services installed on the machine, but there isn't a way to throw a where clause since I get a list of services and its attributes on a single field (See below).

I was wondering if anyone has ran across such request or if anyone has any ideas or suggestions.

This is what I get on my table in a single field when I run the SC command into a # table.


SERVICE_NAME: SQLSERVERAGENT
DISPLAY_NAME: SQLSERVERAGENT
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0


Thanks,

One thing to keep in mind, I have both, 2000 and 2005 servers on my environment. *

---
http://www.ssisdude.blogspot.com/

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-04-24 : 21:46:15
Command 'net start' gives you all running services on the machine.
Go to Top of Page
   

- Advertisement -