A SQL Server Agent alert detects configured SQL Server conditions and notifies operators or initiates a response. It prevents unattended failures from remaining unnoticed until users report incorrect data, especially when errors are absent from the SQL Server error log. section 7.2 section 7.7
Use SQL Server Agent alerts deliberately:
- Treat alerting as a control for unattended processes rather than relying on human checks, job logs, or application error reports. section 7.2
- Review the operational and security trade-offs: backup-job alerts require Database Mail on each instance and may conflict with the CIS Level 1 security benchmark. section 12.4.1
Duplicate-sales-order alert
A configured alert can watch database MagicChoc for message 50001, then notify operator Pete when the condition occurs. The alert and notification are created with msdb.dbo.sp_add_alert and msdb.dbo.sp_add_notification.
