SQL Agent Start Depend On SQL Server Engine

  • Hi Everyone,

    Is it possible to start automatically the SQL Agent when the SQL Server engine? What I mean is the SQL Agent depends if the SQL Server start successfully. I knew that you can start the SQL Agent automatic from the services. But, I just want to know if there is another way, even you will not set the SQL Agent from the services. If the SQL Server Engine start, the SQL Agent will also start automatic even without setting from the services.

    Any comment/suggestion is highly appriciated.

    Thank a lot in advanced.

    Regards,

    Andie 🙂

  • Hi

    You can write a startup procedure which will start sql agent when ever the sql server starts.

    I have done this but i dont have the code right now.

    "Keep Trying"

  • Thanks a lot for the reply.

    You mean i can create SP, to start the Agent once the SQL Server Engine start, but where to put the SP? Thanks 🙂

    Regards,

    Andie

  • as Chirag alluded to, you can use the procedure sp_procoption to run a procedure when SQL server starts, but SQL Agent might not be running.

    here's an article wher ethey discuss using an existing extended stored procedure to try and start the sql agent:

    http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server/13794/SQL-Server-Agent-thro-SP

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yes , use sp_procoption to set up the procedure as a startup procedure. You can create the procedure in the master database if you have the rights to do so.

    "Keep Trying"

  • Thank you guys for all the reply. I'll try first your suggestion and I will post here the result;

    Cheers

    Andie

Viewing 6 posts - 1 through 5 (of 5 total)

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