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.
Configure Database Mail in SQL Server: SQL in Sixty Seconds #039
To configure Database Mail, you need an SMTP account, a profile and permission to use it. The tests here build all three with T-SQL on SQL Server 2025, show the exact errors for missing access, and follow a failed send through the mail log.
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.







