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

Neil Pike

January 24, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like