syspolicy_policy_execution_history (Transact-SQL)


THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Displays the time when policies were executed, the result of each execution, and details about errors if any occurred. The following table describes the columns in the syspolicy_policy_execution_history view.

Column nameData typeDescription
history_idbigintIdentifier of this record. Each record indicates a policy and one time that it was initiated.
policy_idintIdentifier of the policy.
start_datedatetimeDate and time this policy tried to run.
end_datedatetimeTime this policy finished running.
resultbitSuccess or failure of the policy. 0 = Failure, 1 = Success.
exception_messagenvarchar(max)Message generated by the exception if one occurred.
exceptionnvarchar(max)Description of the exception if one occurred.

The syspolicy_policy_execution_history_details view contains related details about the targets of the policy and the condition expressions tested.

Requires membership in the PolicyAdministratorRole role in the msdb database.

Administer Servers by Using Policy-Based Management
Policy-Based Management Views (Transact-SQL)

Community Additions