Start SQL Agent by T-SQL Command

  • Thread starter Thread starter Andrea Moro
  • Start date Start date
A

Andrea Moro

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.
 
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.
 
Hello,

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

LOL.
 
Herfried said:
Hello,



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

;-)

I know what mean LOL, but I don't understand why y are laughing ..
or what let you to laugh
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top