Email reports directly to the hands of your Executives

  • I don't think Database.Mail is available in SQL 2000.

  • I think this is a great idea, and it's similar to one I've used to email myself DBA reports every day.

    xp_sendmail has worked fine for me for years. And very solid. There are bugs and it can be a problem overall, but in many environments it works great.

    alternatively, in SS2K5 and above, use Database Mail instead for sending. In SS2K, xp_smtpmail is also a third party add-in I'd recommend, but there's nothing wrong with using xp_sendmail if it works well in your environment.

  • I suppose I should have qualified my statement with "an environment running multiple mailservers, content filters, and sql server instances."

    The solution presented will not work for me, we do not have Outlook installed on the servers with sql server installed. xp_sendmail has always given us headaches when it comes to mass mailings, which could apply here, but in most cases will not.

    Sorry for jumping the gun, I get a little passionate about my work.

  • How about using SQL reporting services for this purpose. I use reporting services to email patient census to my management team which is scheduled to deliver at specified intervals.

  • Can someone comment on my question regarding html tags? Does bbry not require these?

  • Its a very nice article. As several people have already pointed out, it is not the only possible solution, but it looks like a good one. It is similar to something I use currently, though my executives prefer excel on the laptop so that is what they receive.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/

  • Seth,

    I'm not sure about Blackberry's support for HTML ( maybe someone else could comment ).

    For this specific solution, the email is built only of text, so no HTML tags are needed. The centering function makes sure that everything lines up inside the text. Therefore it will work with any email client regardless of HTML support.

    Austin

  • Seth,

    take a look at the second post in the string; there is a great link to an article that shows how to create an HTML email, and it would be relatively easy to integrate in with the solution in this article.

    Thanks!

    Austin

  • I'm not familiar with Reporting Services, so I can't comment on the merits; however, if you are using it successfully then I would be interested in your experience.

    One aspect of this solution is that it is designed to fit the small screen real estate of the target device ( specifically the blackberry, but could be tweaked for any ). If you are dealing with devices with larger screen real estate, you could increase the columns, or cut the number of columns for smaller screen devices ( older style verizon phones, text messaging, pagers, etc. )

  • I'm not familiary with sp_makewebtask; what does it do?

  • Quick note - good solution to sending report-formatted data in SQL 2000. With the number of 2000 installs out there, this helps.

    Agreed on using DB Mail to send HTML Formatted e-mail and it's relatively easy to drop data into a table. I prefer Reporting Services' Data-driven subscriptions, but in a pinch DB Mail will work.

    And I also agree that execs tend to prefer something pushed to them on a regular basis over anything they have to actively retrieve, no matter how easy it is to retrieve it. It's another step to go through to get the data. Well summarized data in an e-mail is easy to digest and determine if they need more details.

  • I didn't realize that the generated email was text. I was confused by the html table displayed under "Pretty" Output in the article. Nice job on the technique. We are on sql 2000, so I will look into this solution.

    Thanks,

    Seth

  • You can also use msdb.dbo.sp_send_dbmail to embed the resultset directly into the body of the email:

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'SQL Server Agent Mail Profile'

    ,@recipients = @to_list

    ,@copy_recipients = @cc_list

    ,@body = @msg

    ,@query = 'SELECT source, emplid, fullName AS name,

    visaTypeFSA as fsaVisa, visaType as psVisa, reason

    FROM fsaAtlasReporting.dbo.tblDataLinkIDsReport'

    ,@subject = @subject

    ,@attach_query_result_as_file = 0

    ,@query_result_header = 1

Viewing 13 posts - 16 through 27 (of 27 total)

You must be logged in to reply to this topic. Login to reply