我正在使用此查询发送每日报告。我应该对代码进行哪些更改以获取 html 格式的输出?
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'DBMAIL',
@recipients = 'aa@xyz.com',
@query = 'Select Country, CompanyName, round(sum(TotalSale), 0) as Sale, count(*) as DownloadedCount from PW.dbo.SalesReport group by Country, CompanyName order by Country',
@subject = 'Daily Sales Report' ;
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'DBMAIL',
@recipients = 'aa@xyz.com',
@query = 'Select Country,ltrim(rtrim([Store Name])) as Store, round(sum(TotalSale), 0) as Sale, space(3), max(Convert(varchar(10), LastTime, 108)) as [Last update Time] from PW.dbo.SalesReport where len(Country) > 1 group by Country, [Store Name] order by Country, [Store Name]',
@subject = 'Daily Sales Detail'