Sending Alerts Via a Custom SMTP procedure

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/ckempster/sendingalertsviaacustomsmtpprocedure.asp


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

  • I was wondering what the difference would be to use this method, as opposed to a T-SQL method, ie not VB/dll one.

    Like this one:

    http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B312839#3

    As well, a more general and novice question, why would I use this method over something like plain old CDO where I don't have to put in my mail server name (Particularly when I do have a Virtual mail server or whatever else is necessary to send it)?

    Thanks



    Eric Bauer

  • Hi there

    Actually, its the first ive seen the MSDN link, and there is no problem I see it using this method also. Its like all things tech, 101 different solutions to most problems; this is just one of them that works well from other code written, so im going down the service orientated path, a single buisness obj (aka the DLL) and many services that use it (t-sql, vb, vb-script, asp, etc..) from the business apps.

    Cheers

    Ck


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

  • Sounds good to me,

    Thanks



    Eric Bauer

  • I have used an extended stored procedure (freeware) for almost 2 years with success.  You may be interested in taking a look.  http://www.sqldev.net/xp/xpsmtp.htm


    AndyM

  • Great article, Chris!

    I didn't know about SQL Server Agent tokens until now. I plan to use them for an ErrorLog in SQL Server, but I saw a problem that affects your code too: if the error message contains single quotes ('), the string built for the @message parameter ends there, and the remaining words of the error message will be interpreted as another command, usually leading to an error. The solution that I plan to use is to SET QUOTED_IDENTIFIER OFF and use double quotes (") instead of single quotes. There still is a chance of failure, but it's smaller, because there are much fewer error messages that contain double quotes compared to the error messages that contain single quotes.

    Razvan

  • Thanks Razvan

    I will check out single quotes, could be a nasty bug...


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

Viewing 7 posts - 1 through 6 (of 6 total)

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