You can start a stored procedure that is set to automatic execution runs every time an instance of SQL Server is started.
1 2 3 4 5 6 7 8 |
EXEC sp_procoption @ProcName = N'<procedure name>' , @OptionName = 'startup' /* The only value for option is startup. */ , @OptionValue = 'on'; /* (true or on) or off (false or off) */ EXEC sp_procoption @ProcName = N'<procedure name>' , @OptionName = 'startup' , @OptionValue = 'off'; |
Is there any autostart stored procedure on your SQL Server?
You can query:
1 2 3 |
SELECT ROUTINE_NAME FROM MASTER.INFORMATION_SCHEMA.ROUTINES WHERE OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME),'ExecIsStartup') = 1 |