Discussion Locked

how to know if the sqlagent is started

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

There is a procedure ' xp_sqlagent_is_started' which makes it possible to know to it agent sql is started.
but the returns value is always 0 , whatever the state of the agent. Why ?

1 reply

by aaronh

The closest thing I could find was xp_sqlagent_is_starting. It is undocumented and doesn?t seem to be very friendly. What you can try doing is querying the sysprocesses table. If you look under the program_name column you can see how many occurrences of SQLAgent there are when nothing special is running. Then query the same value when something is running and see if it is a higher count. As an example: I typically have two entries for SQLAgent when my box is idle. If I start a SQLAgent backup job and look at the table again, I now have three entries for SQLAgent. The new one shows what step of the job the agent is on.

Hope that helps.

This discussion is closed to new replies.