Design SQL Mail


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

more ▼

asked Jun 29, 2011 at 01:38 PM in Default

avatar image

111 9 9 13

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jun 29, 2011 at 01:49 PM

avatar image

4.9k 4 5

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.

Jun 29, 2011 at 01:56 PM Oleg
  • 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.

Jun 29, 2011 at 05:55 PM Kevin Feasel
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jun 29, 2011 at 01:38 PM

Seen: 892 times

Last Updated: Jun 29, 2011 at 01:38 PM

Copyright 2018 Redgate Software. Privacy Policy