Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.78 KB

sp-syspolicy-set-config-enabled-transact-sql.md

File metadata and controls

70 lines (48 loc) · 1.78 KB
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
sp_syspolicy_set_config_enabled
sp_syspolicy_set_config_enabled_TSQL
sp_syspolicy_set_config_enabled
TSQL

sp_syspolicy_set_config_enabled (Transact-SQL)

[!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

Syntax

sp_syspolicy_set_config_enabled [ @value = ] value
[ ; ]

Arguments

[ @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

Return code values

0 (success) or 1 (failure).

Remarks

You must run sp_syspolicy_set_config_enabled in the context of the msdb system database.

Permissions

Requires membership in the PolicyAdministratorRole fixed database role.

[!INCLUDE policy-administrator-role]

Examples

The following example enables Policy-Based Management.

EXEC msdb.dbo.sp_syspolicy_set_config_enabled @value = 1;

GO

Related content