Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Email SQL Results as HTML table

$
0
0

Hi All, I am very new to SQL queries. I am trying to send query results in a email but cannot figure out how to send as a HTML table. The email is sending just fine, but not formatted.

Below is my query, can you please tell me what to add to make it a formatted table?

-------------------------------------------------------------------------

USE Database

IF EXISTS

(Select left(Table.field,4) as Customer,

left(table.field,11) as Order_Date,

table.field as Part_Number,

table.field as Customer_Part,

table.field as Purchase_Order,

soitem.fquantity as Order_QTY

From table

left outer join table on table.field = table.field

left outer join table on table.field = table.field and table.field = table.field

Where table.field = '000243'

and table.field = '05/21/2003')

BEGIN

EXEC msdb.dbo.sp_send_dbmail

@profile_name = 'Profile name',

@recipients =...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>