Using TSQL to see if SQL Server Agent is running - not using xp_cmdshell

  • Is there a way to check to see if the SQL Server Agent is running via tsql without calling xp_cmdshell or a proc that calls xp_cmdshell?   I wanted to add a feature to our product to first check and see if the Agent is running before creating jobs that our application needs to do. 

    But the login to the application has limited security rights which would limit the ability to directly or indirectly call xp_cmdshell.

    Therefore, I am looking for an alternative code to be able to check if the Agent is running.

     

    Thanks,

     

    Daniel

  • I have tried to find a way to do this, too, with no luck so far. I ended up wrapping the sp_add_job command in a try-catch block.

    Ron Rice

     

  • Thanks.

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

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