title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sp_syspolicy_set_config_enabled (Transact-SQL) |
Enables or disables Policy-Based Management. |
VanMSFT |
vanto |
randolphwest |
06/26/2023 |
sql |
system-objects |
reference |
|
|
|
[!INCLUDE SQL Server]
Enables or disables Policy-Based Management.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_syspolicy_set_config_enabled [ @value = ] value
[ ; ]
Determines whether Policy-Based Management is enabled. @value is sqlvariant, and can be one of the following values:
- 0 or
false
- Disabled - 1 or
true
- Enabled
0
(success) or 1
(failure).
You must run sp_syspolicy_set_config_enabled
in the context of the msdb
system database.
Requires membership in the PolicyAdministratorRole fixed database role.
[!INCLUDE policy-administrator-role]
The following example enables Policy-Based Management.
EXEC msdb.dbo.sp_syspolicy_set_config_enabled @value = 1;
GO