Sets procedure options.
sp_procoption [ @ProcName = ] 'procedure'
, [ @OptionName = ] 'option'
, [ @OptionValue = ] 'value'
[@ProcName =] 'procedure'
Is the name of the procedure for which to set an option. procedure is nvarchar(776), with no default.
[@OptionName =] 'option'
Is the name of the option to set. The only value for option is startup, which sets stored procedure for autoexecution. A stored procedure that is set to autoexection runs every time Microsoft® SQL Server™ is started.
[@OptionValue =] 'value'
Is whether to set the option on (true or on) or off (false or off). value is varchar(12), with no default.
Return Code Values
0 (success) or error number (failure)
Execute permissions default to members of the sysadmin fixed server roles. Startup procedures must be owned by the database owner in the master database.