What does this built-in function do? What is the "history" that it is deleting?
The sp_syspolicy_purge_history is used by Policy Based Management in SQL server to clear out the policy evaluation history.
Extract from SQLServerPedia
SQL Server 2008 introduced a new feature called Policy Based Management. A Policy can be something like xp_cmdshell should not be enabled on an instance. When a policy runs it stores the results in MSDB. Over a period of time, this may will cause unnecessary data getting piled up in MSDB. *The job syspolicy_purge_history prunes the data older than the the days defined in HistoryRetentionInDays property of Policy Management*.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With