This SQL stored procedure automatically closes duplicate events, leaving only the most recent one open. In order for an Event to be considered duplicate, the Job ID, Agent name, Object name and short Event message must match an existing Open or Acknowledged event.
To install this procedure, open and run it in SQL Management Studio, first ensuring the AppManager database is connected.
The stored procedure accepts one optional parameter, @CLOSE_COMMENTED_EVENTS which controls whether Events to which comments have been added will be closed or not. If not provided, a value of zero is used, which prevents commented events from being closed. To also close commented events, set the parameter to 1. For example:
exec _CloseDuplicateEvents 1
The stored procedure may be scheduled to run on a regular basis via the SQL Agent.