Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bugulgad
Starting Member
21 Posts |
Posted - 2008-12-16 : 15:50:28
|
| I have a data validation query that I only want to email if there are results.I figure I will use sp_send_dbmail to send the email of the results....but I don't know how to filter the event to only happen if there are some results.I think there is a function for this, but I can't find what I am looking for. |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-12-16 : 16:01:55
|
| IF EXISTS(YOUR QUERY)BEGIN SP_SEND_DBMAILEND |
 |
|
|
bugulgad
Starting Member
21 Posts |
Posted - 2008-12-16 : 16:26:01
|
| I was thinking there would be a rowcount function to test on > 0 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
bugulgad
Starting Member
21 Posts |
Posted - 2008-12-16 : 16:45:53
|
| thanks all. I went with the IF EXISTS solution, worked great |
 |
|
|
|
|
|