Is SqlServer Agent running?
Hi,
Can anyone give me some clues as to how I programmatically determine if Sql Server Agent is running. I'm using Sql 2005 and c#.
I have found the JobServer property in the SqlServer object but this still doesn't tell me is the service is running!!
Thanks for your help
Graham
[316 byte] By [
Gravy] at [2008-1-2]
this is really a useful class. but do u know how to obtain the machine name from SQL server name?
cos in my application, the user just provoide server name. how can I get the machine name to configure the services on the machine?
Server name is usually machine name (default instance) or machine_name\instance_name for named instances of SQL Server, so it's not a problem.
But anyway you can determine machine name using host_name() system function, if you're already connected to server.
WBR, Evergray -- Words mean nothing...