Udalosti
31. 3., 23 - 2. 4., 23
Najväčšia vzdelávacia udalosť pre SQL, Fabric a Power BI. 31. marec – 2. apríl. Pomocou kódu FABINSIDER ušetríte 400 USD.
Zaregistrujte saTento prehliadač už nie je podporovaný.
Inovujte na Microsoft Edge a využívajte najnovšie funkcie, aktualizácie zabezpečenia a technickú podporu.
Applies to:
SQL Server
Sets or clears a stored procedure for automatic execution. A stored procedure that is set to automatic execution runs every time an instance of SQL Server is started.
Transact-SQL syntax conventions
sys.sp_procoption
[ @ProcName = ] N'ProcName'
, [ @OptionName = ] 'OptionName'
, [ @OptionValue = ] 'OptionValue'
[ ; ]
The name of the procedure for which to set an option. @ProcName is nvarchar(776), with no default.
The name of the option to set. @OptionName is varchar(35), and the only value possible is startup
.
Whether to set the option on (true
or on
) or off (false
or off
). @OptionValue is varchar(12), with no default.
0
(success) or error number (failure).
Startup procedures must be in the dbo
schema of the master
database, and can't contain INPUT
or OUTPUT
parameters. Execution of the stored procedures starts when all databases are recovered and the "Recovery is completed" message is logged at startup.
Requires membership in the sysadmin fixed server role.
The following example sets a procedure for automatic execution.
EXEC sp_procoption @ProcName = N'<procedure name>',
@OptionName = 'startup',
@OptionValue = 'on';
The following example stops a procedure from executing automatically.
EXEC sp_procoption @ProcName = N'<procedure name>',
@OptionName = 'startup',
@OptionValue = 'off';
Udalosti
31. 3., 23 - 2. 4., 23
Najväčšia vzdelávacia udalosť pre SQL, Fabric a Power BI. 31. marec – 2. apríl. Pomocou kódu FABINSIDER ušetríte 400 USD.
Zaregistrujte sa