1
我想通過電子郵件發送查詢結果,它工作正常,但我只需要執行電子郵件,如果結果不爲空。以條件發送電子郵件查詢結果
EXEC msdb.dbo.sp_send_dbmail @profile_name='GDB Admin',
@recipients = '[email protected]',
@subject = 'GDB Warning - THIS IS A TEST',
@body ='Key',
@query = 'select clientkey as apikey, ImportDate from
QueryDData.dbo.QueryData where clientkey not in(''blablablabla'')'
所以如果clientkey爲空,不發送電子郵件