Hi, Basically, if there is no data yo do not copy. Else copy is it.
you can do one thing, you can use a set variable activity and use the below expression. Basically, trying to set a variable with the value : SET NOCOUNT ON or the actual query.
@if(equals(activity('LookupOldDeltaValue').output.firstRow.OldDeltaValue,activity('LookupNewDeltaValue').output.firstRow.NewDeltaValue),
'SET NOCOUNT ON;',
concat(activity('SQLSelectStatement').output.resultSets[0].rows[0].Query,
' WHERE ',
activity('FilterNonActiveTables').output.value[0].DELTA_COLUMN,
' > ''',
activity('LookupOldDeltaValue').output.firstRow[''],
''' AND ',
activity('FilterNonActiveTables').output.value[0].DELTA_COLUMN,
' <= ''',
activity('LookupNewDeltaValue').output.firstRow.NewDeltaValue, ''''))
Next, use an if condition and decide if the variable contains proper query or just set no count on.
@equals(variables('variablename'),'Set No Count On')
In the true part, leave it empty. Meaning, if the variable is bringing Set no count on, we are not going to do anything.
In the false part of the if condition, add a copy activity and use the variable in the source of copy activity.
Hope it works.
Please let us know how it goes.