Start SQL Agent by T-SQL Command

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrea Moro

    Start SQL Agent by T-SQL Command

    As subject, I need to find a way to start sql agent by my own
    sp.

    Sorry, I didn't search on the net, but I'm releasing my app, and
    monday it must run on the customer server.

    --
    Sincerely
    Andrea Moro


  • Richard Brown

    #2
    Re: Start SQL Agent by T-SQL Command

    You can try issuing
    xp_cmdshell 'net start sqlserveragent'

    The returned recordset contains each line output by the startup process, you
    can scan these to determine if errors occur, however, starting the agent a
    second time throws an error message, but doesn't affect anything else.

    The procedure also returns when the command is complete, so you should be
    confident that agent is running when it comes back. You can specify the ",
    nooutput" at the end of the line if you don't want the returned recordset,
    but I would highly recommend it, just to check for errors.

    Let us know if it helps.


    "Andrea Moro" <moroandreaET@t iscalinet.it> wrote in message
    news:ezCzsCKdDH A.2416@TK2MSFTN GP09.phx.gbl...[color=blue]
    > As subject, I need to find a way to start sql agent by my own
    > sp.
    >
    > Sorry, I didn't search on the net, but I'm releasing my app, and
    > monday it must run on the customer server.
    >
    > --
    > Sincerely
    > Andrea Moro
    >
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Start SQL Agent by T-SQL Command

      Hello,

      "Andrea Moro" <moroandreaET@t iscalinet.it> schrieb:[color=blue]
      > Sorry, I didn't search on the net, but I'm releasing my app, and
      > monday it must run on the customer server.[/color]

      LOL.

      --
      Herfried K. Wagner
      MVP · VB Classic, VB.NET
      Die Website von H. Wagner zu .NET, Visual Basic .NET und Classic Visual Basic.



      Comment

      • Andrea Moro

        #4
        Re: Start SQL Agent by T-SQL Command

        Herfried K. Wagner [MVP] wrote:[color=blue]
        > Hello,
        >
        > "Andrea Moro" <moroandreaET@t iscalinet.it> schrieb:[color=green]
        >> Sorry, I didn't search on the net, but I'm releasing my app, and
        >> monday it must run on the customer server.[/color]
        >
        > LOL.[/color]

        What't the LOL issue?

        --
        Saluti
        Andrea Moro


        Comment

        • Herfried K. Wagner [MVP]

          #5
          OT: Re: Start SQL Agent by T-SQL Command

          Hello,

          "Andrea Moro" <moroandreaET@t iscalinet.it> schrieb:[color=blue][color=green]
          > > "Andrea Moro" <moroandreaET@t iscalinet.it> schrieb:[color=darkred]
          > >> Sorry, I didn't search on the net, but I'm releasing my app, and
          > >> monday it must run on the customer server.[/color]
          > >
          > > LOL.[/color]
          >
          > What't the LOL issue?[/color]

          No, it's not a solution. Have a Google Search on what "LOL" means.

          ;-)

          --
          Herfried K. Wagner
          MVP · VB Classic, VB.NET
          Die Website von H. Wagner zu .NET, Visual Basic .NET und Classic Visual Basic.



          Comment

          • Andrea Moro

            #6
            Re: Re: Start SQL Agent by T-SQL Command

            Herfried K. Wagner [MVP] wrote:[color=blue]
            > Hello,
            >
            > "Andrea Moro" <moroandreaET@t iscalinet.it> schrieb:[color=green][color=darkred]
            >>> "Andrea Moro" <moroandreaET@t iscalinet.it> schrieb:
            >>>> Sorry, I didn't search on the net, but I'm releasing my app, and
            >>>> monday it must run on the customer server.
            >>>
            >>> LOL.[/color]
            >>
            >> What't the LOL issue?[/color]
            >
            > No, it's not a solution. Have a Google Search on what "LOL" means.
            >
            > ;-)[/color]

            I know what mean LOL, but I don't understand why y are laughing ..
            or what let you to laugh

            --
            Saluti
            Andrea Moro


            Comment

            • Cor

              #7
              Re: Re: Start SQL Agent by T-SQL Command

              Andrea,

              A lot of people are helping here beside there regulair job for free, but
              maybe you did not know this?
              And they expect to help people who are desperate and can not find things
              after a long time searching.

              Yes you are right it had to be COL, (Crying On Line).

              Cor


              Comment

              • Herfried K. Wagner [MVP]

                #8
                Re: Re: Start SQL Agent by T-SQL Command

                Hello,

                "Cor" <non@non.com> schrieb:[color=blue]
                > Yes you are right it had to be COL, (Crying On Line).[/color]

                ROFL.

                EOT.

                --
                Herfried K. Wagner
                MVP · VB Classic, VB.NET
                Die Website von H. Wagner zu .NET, Visual Basic .NET und Classic Visual Basic.



                Comment

                Working...