Skip to main content

I’d like to get information if certain job finishes successfully, but 0 rows are replicated. I found snippet that send email, but how can I write an “if query” that catches only  those scheduled jobs that I want? There is snippet template for that, but I don’t understand how it need to be modified

 


<!-- Enumerate Through Query Results -->
<api:enum prefix="Query#">
<api:set attr="temp.index" value="e_index]" />
<api:set attr="temp.query" value="r_value]" />
<api:set attr="temp.status" value="uQueryStatus#u_index]]" />
</api:enum>

 

 

Oooh, that would be a nice feature to add, under the Notification section.  A checkbox for “send email if 0 rows loaded into destination”.


Even better, set that threshold for load volume at the Task level.  Some tables might be OK to have 0 rows replicated.  But other tables in the job, you might normally and always have 100K rows, so loading 0 would be atypical.


<api:if exp="[AffectedRows] == 0">
<api:set attr="mail.Subject" value="Post-Event Mail"/>
<api:set attr="mail.Message" value="[JobName] : [JobStatus] : [AffectedRows] : [RunStartDate]"/>
<api:set attr="mail.To" value= "[email protected]"/>
<api:call op="appSendEmail" in="mail"/>
</api:if>

This is the working script for this purpose

 

 

 


 

 

Reply