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.
是否有其他方式發送觸發失敗的電子郵件? 或者如何解決這個問題?