Last post Jan 21, 2015 12:54 AM by Edwin Guru Singh
Jan 20, 2015 07:41 AM|tvb2727|LINK
I am going to log some information when sending emails. I need to log when the email was sent and who it was sent to. The only thing is this: IF there is a failure around this block of code in my stored procedure, I do NOT want another error to occur.
Basically I want to fail silently if it was not able to insert that information into the specific table. What is the best way to do this in SQL server 2008 stored procedure, so I can fail silently?
Jan 20, 2015 07:54 AM|PatriceSc|LINK
You have now
Do you send those mails from your SP? Afaik you have already some tracking done for you:
http://msdn.microsoft.com/en-us/library/ms188023.aspx (not sure if enough).
Jan 21, 2015 12:54 AM|Edwin Guru Singh|LINK
As per your case ,I have been shared my suggestion below:
1. you can use Transaction with Try-Catch in stored procedure
2.If you don't want to raise any error in the catch block. you just Rollback in catch block
3.Commit the transaction at last.
For your reference ,check the following link :