sp_makestartup System Stored Procedure

Sets a stored procedure for auto execution. Auto execution stored procedures are executed every time the server is started.

Syntax

sp_makestartup procedure_name

where

procedure_name
Specifies the name of the procedure to start automatically when the server is started.

Remarks

There is no limit to the number of startup procedures you can have, but be aware that each auto execution procedure consumes one connection. If you need to execute multiple procedures at startup but don't need to execute them in parallel, you can make one procedure the startup procedure and have that procedure call the other procedures. For more information, see the CREATE PROCEDURE statement.

Example

This example makes the update_all_stats procedure an auto execution procedure.

sp_makestartup update_all_stats

Permission

Only the system administrator can use this procedure.

Tables Used

master.dbo.sysobjects, master.dbo.syscolumns

See Also

CREATE PROCEDURE sp_unmakestartup
sp_helpstartup