| title | Configure the scan for startup procs Server Configuration Option | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 03/02/2017 | |
| ms.prod | sql-non-specified | |
| ms.prod_service | database-engine | |
| ms.service | ||
| ms.component | configure-windows | |
| ms.reviewer | ||
| ms.suite | sql | |
| ms.technology |
|
|
| ms.tgt_pltfrm | ||
| ms.topic | article | |
| helpviewer_keywords |
|
|
| ms.assetid | 6bf9d252-e766-458d-9dcd-23d895f032a2 | |
| caps.latest.revision | 27 | |
| author | MikeRayMSFT | |
| ms.author | mikeray | |
| manager | craigg | |
| ms.workload | Inactive |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md]
This topic describes how to configure the scan for startup procs server configuration option in [!INCLUDEssCurrent] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql]. Use the scan for startup procs option to scan for automatic execution of stored procedures at [!INCLUDEssNoVersion] startup time. If this option is set to 1, [!INCLUDEssNoVersion] scans for and runs all automatically run stored procedures that are defined on the server. The default value for scan for startup procs is 0 (do not scan).
In This Topic
-
Before you begin:
-
To configure the scan for startup procs option, using:
-
Follow Up: After you configure the scan for startup procs option
-
This option is an advanced option and should be changed only by an experienced database administrator or certified [!INCLUDEssNoVersion] professional.
-
The value for this option can be set by using sp_configure; however, it will be set automatically if you use sp_procoption, which is used to mark or unmark automatically run stored procedures. When sp_procoption is used to mark the first stored procedure as an autoproc, this option is set automatically to a value of 1. When sp_procoption is used to unmark the last stored procedure as an autoproc, this option is automatically set to a value of 0. If you use sp_procoption to mark and unmark autoprocs, and if you always unmark autoprocs before dropping them, there is no need to set this option manually.
Execute permissions on sp_configure with no parameters or with only the first parameter are granted to all users by default. To execute sp_configure with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. The ALTER SETTINGS permission is implicitly held by the sysadmin and serveradmin fixed server roles.
-
In Object Explorer, right-click a server and select Properties.
-
Click the Advanced node.
-
Under Miscellaneous, change the Scan for Startup Procs option to True or False by selecting the value you want from the drop-down list box.
-
Connect to the [!INCLUDEssDE].
-
From the Standard bar, click New Query.
-
Copy and paste the following example into the query window and click Execute. This example shows how to use sp_configure to set the value of the
scan for startup procsoption to1.
USE AdventureWorks2012 ;
GO
EXEC sp_configure 'show advanced options', 1 ;
GO
RECONFIGURE
GO
EXEC sp_configure 'scan for startup procs', 1 ;
GO
RECONFIGURE
GO
The server must be restarted before the setting can take effect.
RECONFIGURE (Transact-SQL)
Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)
sp_procoption (Transact-SQL)