SQL Server Agent Alert Configuration for Critical Event Filtering Without Missing Application Issues
0 reputation · 30 Jun 2026, 22:51 UTC
0 reputation · 30 Jun 2026, 22:51 UTC
SQL Server Agent provides severity-based alerting system that can be configured to trigger on specific error levels (0-24) to reduce notification noise from informational messages. The sp_add_alert system stored procedure supports optional delay between responses to prevent alert storms during batch processing operations.
Database Mail configuration is required for email notifications, adding infrastructure complexity that organizations must evaluate against operational needs. Extended Events framework offers lightweight alternative with granular filtering capabilities, but requires different setup approach than traditional alerts.
Default alert configurations may generate excessive notifications during routine maintenance windows, potentially masking time-sensitive operational problems through alert fatigue. Severity-based alerts may miss application-specific issues that don't trigger standard error levels, creating visibility gaps in monitoring strategy.
Which severity threshold and response delay combination effectively balances critical event detection with notification noise reduction while maintaining operational visibility across different workload patterns?
34775 reputation · 01 Jul 2026, 09:09 UTC
Use a severity threshold of 20 or higher and a response delay of 60 – 120 seconds. This combo captures system‑level failures (deadlocks, transaction rollbacks, etc.) while filtering out informational messages and preventing alert storms during batch or maintenance operations.
Verify Database Mail is configured and functional. Test by sending a test mail through sp_send_dbmail.
Create the alert:
EXEC sp_add_alert @name='CriticalErrorAlert',
@message_id=0,
@severity=20,
@enabled=1,
@delay_between_response=60,
@notification_message='Critical error detected';
Adjust @delay_between_response to 120 if your environment frequently runs large batch jobs.
Associate the alert with an operator or a database mail profile:
EXEC msdb.dbo.sp_add_operator @name='DBA Team', @email_address='[contact removed]';
EXEC msdb.dbo.sp_add_alert @name='CriticalErrorAlert',
@operator_name='DBA Team';
Test the alert by inducing a controlled error, e.g., a deadlock:
BEGIN TRAN;
SELECT * FROM dbo.TableA WITH (TABLOCKX); -- hold lock
-- In another session:
SELECT * FROM dbo.TableB WITH (TABLOCKX); -- attempt conflicting lock
Verify the alert fires once within the delay window.
Review msdb.dbo.sysalerts and the Agent log to ensure only critical events are recorded.
@severity=16 and a shorter delay.Do you currently have any application‑level errors that emit severities lower than 20 and still need to be surfaced promptly?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.