x

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
more ▼

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

Shivu gravatar image

Shivu
111 8 9 10

(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

SirSQL gravatar image

SirSQL
4.8k 1 3

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
+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.
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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x713
x29
x6

asked: Jun 29, 2011 at 01:38 PM

Seen: 691 times

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