
Automatically Execute Stored Procedures When Starting SQL Server
Use sp_procoption to execute a stored procedure automatically at the time of starting SQL server. The stored procedure that needs to be executed should be created in the master database and owned by a member of the sysadmin role. You can use this procedure to automate tasks like backups and