How can I make sure the SQL Server agent auto-starts when I start SQL Server?

A. As long as the service is set to auto it will start when the server starts, but if SQL and the Agent are shutdown manually then the Agent won't auto-start when SQL does. You can run the following proc or enable it as a startup stored-proc to overcome this. (This will only work with Window NT/2000 as Win9x does not support services).

CREATE PROC AUTOAGENT
AS
EXEC XP_CMDSHELL 'NET START SQLSERVERAGENT'
go
SP_PROCOPTION AUTOAGENT, STARTUP, TRUE


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish