Database Mail history stays in msdb until you delete it, so the sysmail tables can grow for years. This post measures the tables, then removes the history with the two supported procedures instead of direct deletes. It also covers a month by month loop for a big backlog and a schedule.
Sending an HTML Table by Email With sp_send_dbmail
Turn a wall of report text into a clean table. FOR XML PATH escapes your data, and a few small tricks handle NULL values and empty days.
Sending a Microsoft Teams Alert From a SQL Server Agent Job
Send a Teams alert from a failed SQL Server Agent job with a Workflows webhook, PowerShell, SQL Server 2025 REST calls, and mail fallback.
SQL SERVER – Introduction to Service Broker
Service Broker supports transactional asynchronous messaging within SQL Server. I separate queued work from the application that processes it.
Setting Up Database Mail for Alerts
Setting up Database Mail for alerts means creating an account and profile, testing delivery, linking Agent, and checking the queue when mail stops.







