Export (0) Print
Expand All
Expand Minimize


SQL Server 2000

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.

See Also


System Stored Procedures

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft