0
我已成功配置并能够通过调用msdb.dbo.sp_send_dbmail存储过程使用SQL Server 2008 R2上的“数据库邮件”发送电子邮件。 我可以通过将它放入try-catch块来捕捉触发器中查询的失败。触发失败发送电子邮件
但我需要做的是,当触发器无法执行查询时发送电子邮件。但是我不能在catch块中执行上面的存储过程。它给了我下面的错误。
Msg 3930, Level 16, State 1, Procedure sp_send_dbmail, Line 64
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
The statement has been terminated.
是否有其他方式发送触发失败的电子邮件? 或者如何解决这个问题?