sys.sp_syspolicy_set_config_history_retention

general
#stored-procedure

Description

Specifies the number of days to keep policy evaluation history for Policy-Based Management. The number of days to retain Policy-Based Management history. in the context of the , the history isn’t automatically removed. To view the current value for history retention, run the following query:

Syntax

sp_syspolicy_set_config_history_retention

Remarks

Specifies the number of days to keep policy evaluation history for Policy-Based Management.

The number of days to retain Policy-Based Management history.

(success) or

You must run

in the context of the

, the history isn’t automatically removed.

To view the current value for history retention, run the following query:

Examples

Example 1

SELECT current_value
FROM msdb.dbo.syspolicy_configuration
WHERE name
=
'HistoryRetentionInDays'
;

Example 2

EXECUTE msdb.dbo.sp_syspolicy_set_config_history_retention @
value
= 28;
GO