exec msdb.dbo.sp_send_dbmail
achilleas_delenda
Posts: 2 New member
Hi all,
We are big users of the custom metrics.
We were looking to find ways to enhance them by allowing the metric to send an email when a condition has been met.
When we run the query (exec msdb.dbo.sp_send_dbmail etc.) directly on the SQL instance , an email is sent successfully, however, when we run it via SQL Monitor, nothing happens.
Anyone got any ideas?
Thanks in advance,
Achilleas
We are big users of the custom metrics.
We were looking to find ways to enhance them by allowing the metric to send an email when a condition has been met.
When we run the query (exec msdb.dbo.sp_send_dbmail etc.) directly on the SQL instance , an email is sent successfully, however, when we run it via SQL Monitor, nothing happens.
Anyone got any ideas?
Thanks in advance,
Achilleas
Tagged:
Answers
I completely forgot that everything done in the Custom Metric T-SQL section is done in a transaction that is rolled back which stops the email from being sent.
This is for security reasons and the initial intention of the custom metric was just to gather data not to modify anything.
I would suggest looking to see if there is a suggestion on https://sqlmonitor.uservoice.com/forums/91743-suggestions for this and if not raising your own.
Kind regards,
Alex
Have you visited our Help Center?