Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

How to email sql stored procedure results only when there are results?

$
0
0

I have a SQL stored procedure that looks for leavers accounts each day, most days this doesn't return any results but wondering whether it is possible to use exec msdb.dbo.sp_send_dbmail to send the results of the stored procedure as an email but to only send the results when there are some, so that I'm not sending a blank email most days.


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>