4

First off, I'm using SQL Server 2008 R2.

When I set up my maintenance plan and got to the "Select Report Options" step, I selected to email the report to the Operator I already have set up. This does not allow me to alter the subject, which I believe Gmail uses when it collapses emails into conversations.

Is there a way to trick Gmail to separating them out based on the database? Or is there a better way from within SQL Server Management Studio to email the reports out? I have multiple instances, with their own Operator, each Operator is using the same email address (no_reply@noneofyourbusiness.com), but the name is different....but since the subject is the same, Gmail still collapses them into one big conversation.

Does anyone else have to deal with this issue?

  • Sorry for going offtrack but do you feel this is a very good solution? Would you rather have your logs on a FTP server where you have full control and more security? Also, how are you sending them to gmail exactly? – Ali Razeghi Jul 31 '13 at 20:32
  • 1
    Maybe change the subject line of the email..? I'm not sure what Gmail does to group into conversations, so without finding out particularly how they determine what's a "conversation", it'd just be guessing. – Thomas Stringer Jul 31 '13 at 20:50
  • Please take the hold off this question, it is a basic functionality of SQL Server Management Studio to send out emails of Maintenance Plan logs. – unclenevin Aug 1 '13 at 14:25
  • How about adding another step to your maintenance plan which uses TSQL to send out the mail? This way you can customize each mail using programming. – StanleyJohns Aug 1 '13 at 15:36
3

The easiest way would be to send the email with differing subject lines. If you just want different database in different conversations make sure the database name is included in the subject line. If you want a new conversation for each email sent, include a timestamp in the subject line.

  • I have reworded my question to include this piece: "When I set up my maintenance plan and got to the "Select Report Options" step, I selected to email the report to the Operator I already have set up. This does not allow me to alter the subject, which I believe Gmail uses when it collapses emails into conversations." Am I wrong or missing something? – unclenevin Aug 1 '13 at 14:25
2

Why not make a direct call to the system stored sp_notifiy_operator which accepts a parameter @subject.

You can likely "extend" the maintenance plan to support this however my own personal preference would be to use a SQL Server Agent Job to manage a report/notification process that required this level of customisation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.