I would like to check if the results for a select query is null. If there are no rows returned print "no rows" else send an email.What is the preferred way to script this.Is there a better way to accomplish this other than this?IF EXISTS(SELECT .... FROM Table1 where ....) BEGIN msdb.dbo.sp_send_dbmail.... END ELSE PRINT 'No Rows'Many thanks.
↧