question

Shivu avatar image
Shivu asked

Design SQL Mail

Hi I want to design a Stored Proc to send out emails in the followinf format. Insert Data(1 Paragraph- About 10 sentences- Remains the same for all emails) Insert Table (Different for different emails) Static Data (1 Paragraph - About 15 sentences- Remains the same for all emails) I know how to get the table there but what would be the best way to Insert the 2 paragraphs? Store them in a table? Or in a temporary folder? Thanks, Shivu
sqldbmailsql-email
10 |1200

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

1 Answer

·
SirSQL avatar image
SirSQL answered
Either store them in a table or leave them as data within the stored procedure. Both solutions would work easily, it depends on how often changes would be made to the static paragraphs and who would make potential changes to them. It would be better to allow users permissions to update that data in a table than alter the procedure.
2 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.

Oleg avatar image Oleg commented ·
It would probably be even better to leave the database mail alone for this one. I mean it is easy enough to outsource the activity of sending email to the front end and reduce the procedure to only insert data. Database mail was originally designed so it could send alerts to the DBA about completed/failed jobs, but eventually was somehow expanded to perform the tasks which clearly belong to the front ends.
2 Likes 2 ·
Kevin Feasel avatar image Kevin Feasel commented ·
+1 for Oleg. That does sound like a front-end type of task. If you migrate that back to the application layer, you'll gain some advantages like being able to format the text better.
0 Likes 0 ·

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.