Skip to content
Advertisement

Tag: sp-send-dbmail

Convert a SQL query result table to an HTML table for email

I am running a SQL query that returns a table of results. I want to send the table in an email using dbo.sp_send_dbMail. Is there a straightforward way within SQL to turn a table into an HTML table? Currently, I’m manually constructing it using COALESCE and putting the results into a varchar that I use as the emailBody. Is there

Advertisement