Enable SQL Server to Run Stored Procedures at Server Startup

In order to execute a Stored Procedure when SQL Server starts, you first need to enable scanning for Startup Procedures with the following code:

EXEC sys.sp_configure N'scan for startup procs', N'1'GORECONFIGURE WITH OVERRIDEGO

Once you have configured your server to run Stored Procedures on startup, you have to enable the desired Stored Procedure to run at startup:


Now, each time your server is started the above stored procedure (named ProcToRunAtEachStartup – you can name yours anything you like) will run.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

More From DevX