question

artistlover avatar image
artistlover asked

Email and creating a table

I am creating a stored procedure to send an email. Insert into tblemail body From xxx where How can i add a table into the middle with veribage above and below it and not just using html table formatting? I think it will have to be html but I am not sure how to add verbiage above and below the table. Ideas?
email
6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·
Forgive me as I don't understand. What is the desired output? Can you post the entire code block? Do you mean an HTML table?
0 Likes 0 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
Pretty sure, how to add a table to the text in the email, not adding a SQL Server table. Right?
0 Likes 0 ·
artistlover avatar image artistlover commented ·
Right. i posted my code but i don't see it now. Did you see it?
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
Pulled from the spam bin... DECLARE @xml NVARCHAR(MAX) DECLARE @body NVARCHAR(MAX) SET @xml =CAST(( SELECT [Dlr Num] AS 'td',' ', [Proc Date 2]AS 'td',' ', ' ', [Claim Num]AS 'td',' ', [Claim Num 2]AS 'td',' ', [Invoice Num]AS 'td',' ', [Inv Num 2]AS 'td',' ', [Amt Claimed]AS 'td' FROM GM.dbo.vwxx FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX)) sET @body =' Duplicate records for xxUnpaid (Source-xx-xx-vwxx) [xx] [ProcDate2] [xx] [xx2] [Invoice Num] [Invoice Num 2] [Amt Claimed] ' SET @body = @body + @xml +' ' You are receiving this e‐mail because your dealer(s) have co‐op claim(s) requiring additional backup documentation in order to be completed. Table is below Proc Date Dlr Num Dlr Name Claim # Control Num 09/08/15 510914 xx 1002914 9056003700 09/08/15 511964 xx 1003221 9056003711 09/08/15 516924 xx 1003146 9056003707 09/08/15 524203 xx 1002661 9056003699 table is above This will be the only e‐mail alert you will receive for these co‐op claim(s).
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
also... You are receiving this e‐mail because your dealer(s) have xxclaim(s) requiring additional backup documentation in order to be completed. Table below Proc Date Dlr Num Dlr Name Claim # Control Num 09/08/15 510914 xx1002914 9056003700 09/08/15 511964 xx 1003221 9056003711 09/08/15 516924 xx1003146 9056003707 09/08/15 524203 xx 1002661 9056003699 table above This will be the only e‐mail alert you will receive for these claim(s).
0 Likes 0 ·
artistlover avatar image artistlover commented ·
Thank you Thomas.
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.