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" <mo**********@tiscalinet.it> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
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