SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sending Alerts Via a Custom SMTP procedure


Sending Alerts Via a Custom SMTP procedure

Author
Message
ckempste
ckempste
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2323 Visits: 1
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"
Eric Bauer
Eric Bauer
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 1

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
ckempste
ckempste
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2323 Visits: 1

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"
Eric Bauer
Eric Bauer
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 1

Sounds good to me,

Thanks





Eric Bauer
mealina
mealina
SSC-Enthusiastic
SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)

Group: General Forum Members
Points: 105 Visits: 8

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
Razvan Socol
Razvan Socol
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1141 Visits: 129

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





ckempste
ckempste
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2323 Visits: 1

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"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search