agent running?

  • MSSQL2K / SP3 ... Is there a way in TSQL to check to see if the SQL Server Agent is running? I need to check this for scripts that apply changes to replication, etc.

  • master..xp_servicecontrol 'querystate', 'SQLSERVERAGENT'



    Shamless self promotion - read my blog http://sirsql.net

  • thanks stacenic .. this is just what I am looking for .. now, I know there is a way to start the SQL Server Agent from a command line, but is there also a way to start it from within TSQL? .. (without using xp_cmdshell)

  • master..xp_servicecontrol 'START', 'SQLSERVERAGENT' --starts

    master..xp_servicecontrol 'STOP', 'SQLSERVERAGENT' -- stops

     

     



    Shamless self promotion - read my blog http://sirsql.net

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

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