HomeSoftwareServicesForumsLinksContact us
Overview  |  Download  |  Online Demo  |  Licensing  |  Release Notes
  SqlAnswersMail - Online Demo

Demo 1 - Email HTML | Demo 2 - Email PDF | Demo 3 - SQL to PDF | Demo 4 - Embedded Queries
Demo 5 - Prescheduled Queue | Demo 6 - Dynamic Queue | Demo 7 - Zip & Password-Protect
Demo 8 - Mail Merge | Demo 9 - Content Path | Demo 10 - Excel Workbook | Demo 11 - Word/RTF

Demo 4 - Sending embedded query results

Description You can embed query results in the content of the @message parameter by using placeholders that follow the pattern of {Query#} where # stands for an ordinal position of a SQL statement in the @query parameter. For example, if you have a query that contains two statements, you can issue the following command to embed these statements within the content of a message. To run the demo, please provide an email address to send the results to and click on the Run Demo 4 button.
Email
SQL Code
exec sp_SendSAM
@recipients = provided in form,
@message =
'<p>This message has two resultsets displayed side-by-side</p>
<table>
<tr>
<td valign=top>{Query1}</td>
<td valign=top>{Query2}</td>
</tr>
</table>'
,
@format = 'HTML',
@query = 'select FirstName, LastName, Photo from northwind..employees;
select ContactName, ContactTitle from northwind..customers'


               

Free Trial of SqlAnswersMail