September 25, 2007 at 2:35 am
Morning,
When a table is updated I have a trigger to insert data into a reporting table. Every 15 minutes I run a Job which fires a cursor to select new entries, send an Email and then update the reporting table attribute "Email_Sent" with a Y to ensure that duplicate Emails are not sent.
Works well in most cases. However, it occassionaly fails to send the Emails, but still updates the reporting table attribute "Email_Sent" with a Y. Can I insert the cursor into a Transaction to ensure that the table is only updated if the Emails are sent?
For those that are interested the Job fails with the following error.
SqlDumpExceptionHandler: Process 64 generated fatal exception c0000005
EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process. [SQLSTATE HY000] (Error 0)
Associated statement is not prepared [SQLSTATE HY007] (Error 0).
The step failed.
All thoughts welcome and thank you in advance for any advice.
Colin
September 25, 2007 at 3:26 am
You can have error handling and update status only if after sending email @@Error remains = 0.
_____________
Code for TallyGenerator
September 25, 2007 at 8:05 am
Thank you very much. I suppose that I now have to wait for a failure to test the code. 😉
Colin
September 25, 2007 at 11:12 am
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply