Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to email exceptions from stored proc

Author  Topic 

Bex
Aged Yak Warrior

580 Posts

Posted - 2005-02-17 : 05:21:01
Morning all

Hope you are all super dooper!

An application has to insert data into a database by calling a stored procedure. At times, the data received is incorrect, and therefore, I am trying to enforce some validation within a stored proc so that we at least know where the source of the problem is (basically the application fell over and it took someone a while to locate the problem).

When an exception occurs, I would like to send an email to myself, to inform me of the exception. I have been informed that this is possible in a sp, but thats about it. Can anyone tell me where to look for information on how to do this or better still, give an example?? Thanks in advance.

Hearty head pats

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2005-02-17 : 05:22:45
You might want to take a look at this, works great for me:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36293

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-02-17 : 05:23:57
search here for SENDMAIL and follow the links, one of which is http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=20447&SearchTerms=sendmail


this should help you towards a solution.
Go to Top of Page

Bex
Aged Yak Warrior

580 Posts

Posted - 2005-02-17 : 05:54:44
Thats great. Thanks a lot, I shall spend the rest of this morning investigating.

Hearty head pats
Go to Top of Page
   

- Advertisement -