SQL Agent Service

  • Using Transact-SQL, how can I find out whether SQLAgent is running? I am able to view it through SQLServer Management Studio but how about using T-SQL.

    Thanks.

    Sahoong.

  • You can run this query:

    xp_servicecontrol 'querystate', 'SQLSERVERAGENT'

    Regards,

    Phil

  • Many thanks Phil!

  • Phil,

    How do I capture the results of the query in a variable so can perform subsequent business logic in my procedure?

    Thanks.

    Ken

Viewing 4 posts - 1 through 3 (of 3 total)

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