DESCRIPTION
This alert applies to SQL Server instances only and identifies SQL statements that have been actively running longer than the specified threshold. To monitor for long-running queries (e.g., over 5 minutes which is the default), set the Critical threshold to 300 seconds (Min) and leave Max blank. Ensure the alert execution interval is set to 5 minutes or less for timely detection.
An optional parameter, @KillSession, can be enabled to automatically terminate sessions exceeding the defined duration.
ALERT DEFINITION
To create the alert, click on Alerts > Manage Alerts tab and create a Custom Alert of type Custom SQL Alert - Multiple Numeric Return. Configure the alert similar to below and paste in the attached query.
